G
Guest
I have setup the following lines of code:
System.AppDomain.CurrentDomain.SetPrincipalPolicy(Security.Principal.PrincipalPolicy.WindowsPrincipal)
mPrincipal = System.Threading.Thread.CurrentPrincipal
mUser = mPrincipal.Identity
' Create generic identity.
mApplicationIdentity = New
Security.Principal.GenericIdentity(controlCenterConfiguration.Employee.Alias)
' Create generic principal.
mApplicationPrincipal = New
Security.Principal.GenericPrincipal(mApplicationIdentity, rolesArray)
'set the thread to run under this new identity
System.Threading.Thread.CurrentPrincipal = mApplicationPrincipal
I am able to use code-based security using this with no problem.
What is not clear to me is how Integrated Security with SQL is still
working. My instinct says it should not work, but it does. I would have
thought my WindowsIdentity would have been replaced by my GenericIdentity and
the thread would not have my windows authentication information.
Will someone explain this to me?
System.AppDomain.CurrentDomain.SetPrincipalPolicy(Security.Principal.PrincipalPolicy.WindowsPrincipal)
mPrincipal = System.Threading.Thread.CurrentPrincipal
mUser = mPrincipal.Identity
' Create generic identity.
mApplicationIdentity = New
Security.Principal.GenericIdentity(controlCenterConfiguration.Employee.Alias)
' Create generic principal.
mApplicationPrincipal = New
Security.Principal.GenericPrincipal(mApplicationIdentity, rolesArray)
'set the thread to run under this new identity
System.Threading.Thread.CurrentPrincipal = mApplicationPrincipal
I am able to use code-based security using this with no problem.
What is not clear to me is how Integrated Security with SQL is still
working. My instinct says it should not work, but it does. I would have
thought my WindowsIdentity would have been replaced by my GenericIdentity and
the thread would not have my windows authentication information.
Will someone explain this to me?