B
Bob Erwin
Hi there,
I have been reading up on Authorization and role based security for a couple
of days now, and am trying to implement this in my applications.
I'm having a problem with my roles being reconized by using the
user.isinrole("test") on the redirected page after the Login.
for instance, here is my code after I log into the page:
Dim test() As String = {"OEM", "test"}
HttpContext.Current.User = New GenericPrincipal(User.Identity, test)
FormsAuthentication.RedirectFromLoginPage(txtUsername.Text, False)
At this point if I break at the formsAuthentication.....I watch the
User.isinrole("test") it shows up true, however, when I get redirected to
the webform1.aspx page and also watch user.isinrole("test") then it is
false.
I'm really confused on what I need to do...I've tried the
Threading.currentprincipal = new genericPrincipal(User.Identity, test) and
that didn't work as well. The User.identity.isauthenticated does come over
and also the User.identity.name comes over, it is just the
user.isinrole("test") that does not come over.
Any thoughts?
You help is greatly appreciated...
Thanks,
Bob
I have been reading up on Authorization and role based security for a couple
of days now, and am trying to implement this in my applications.
I'm having a problem with my roles being reconized by using the
user.isinrole("test") on the redirected page after the Login.
for instance, here is my code after I log into the page:
Dim test() As String = {"OEM", "test"}
HttpContext.Current.User = New GenericPrincipal(User.Identity, test)
FormsAuthentication.RedirectFromLoginPage(txtUsername.Text, False)
At this point if I break at the formsAuthentication.....I watch the
User.isinrole("test") it shows up true, however, when I get redirected to
the webform1.aspx page and also watch user.isinrole("test") then it is
false.
I'm really confused on what I need to do...I've tried the
Threading.currentprincipal = new genericPrincipal(User.Identity, test) and
that didn't work as well. The User.identity.isauthenticated does come over
and also the User.identity.name comes over, it is just the
user.isinrole("test") that does not come over.
Any thoughts?
You help is greatly appreciated...
Thanks,
Bob