RE: FormsAuthentication Roles Problem
From: [MSFT] (lukezhan_at_online.microsoft.com)
Date: 11/26/04
- Next message: Glenn: "RE: Implementing RSACryptoServiceProvider *and* JavaScript"
- Previous message: [MSFT]: "RE: Forms Authentification"
- In reply to: James McFarland: "RE: FormsAuthentication Roles Problem"
- Next in thread: Patrick.O.Ige: "RE: FormsAuthentication Roles Problem"
- Reply: Patrick.O.Ige: "RE: FormsAuthentication Roles Problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Fri, 26 Nov 2004 04:10:17 GMT
Since you use Form authentication, can you explain more about how you
implement IPrincipal.IsInRole and Application_AuthenticateRequest?
Normally, we need grant roles in Application_AuthenticateRequest like:
Sub Application_AuthenticateRequest(ByVal sender As Object, ByVal e As
EventArgs)
if (not(HttpContext.Current.User is Nothing)) then
if HttpContext.Current.User.Identity.AuthenticationType = "Forms" then
Dim id as System.Web.Security.FormsIdentity
id = HttpContext.Current.User.Identity
Dim MyRoles(2) As String
MyRoles(0) = "Manager"
MyRoles(1) = "Admin"
HttpContext.Current.User = new
System.Security.Principal.GenericPrincipal(id,MyRoles)
End if
End if
End sub
Luke
- Next message: Glenn: "RE: Implementing RSACryptoServiceProvider *and* JavaScript"
- Previous message: [MSFT]: "RE: Forms Authentification"
- In reply to: James McFarland: "RE: FormsAuthentication Roles Problem"
- Next in thread: Patrick.O.Ige: "RE: FormsAuthentication Roles Problem"
- Reply: Patrick.O.Ige: "RE: FormsAuthentication Roles Problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|
|