Ugh. I've been wrestling with a similar problem for days now. Even sent an email to Scott Mitchell requesting his advice --- but got no response.
I followed the instructions to a "t" in Mitchell's third security tutorial on www.asp.net, "Forms Authentication Configuration and Advanced Topics," specifically, Steps 4 and 5 for "Storing Additional User Data in the Ticket" and "Using a Custom Principal," respectively.
Admittedly, Mitchell presents that tutorial before presenting any discussion of ASP.NET's roles framework. Consequently, the instructions cited above don't take roles into consideration.
But later, in his eleventh tutorial in the ASP.NET security tutorial series, "Role-Based Authorization," Mitchell acknowledges that most real-world security implementations use roles, and he doesn't indicate how the custom principal implemented in tutorial 3 can be updated to support them.
I have found that when one implements Mitchell's custom principal in an ASP.NET application utilizing the standard ASP.NET membership and role providers, URL security ceases to work.
Apparently (although I haven't fully confirmed this yet), the standard role provider's RoleManagerModule runs in the HTTP application's PostAuthenticateRequest event AFTER the event handler that Mitchell describes for creating the custom principal in tutorial 3, replacing one's CustomPrincipal with a RolePrincipal object containing a FormsIdentity object rather than the CustomIdentity object also described in Mitchell's tutorial.
Custom user data stored in the UserData string of my authentication ticket also survives.
But all forms of roles based authorization fails.
To emphasize, everything works if I simply include the following code in my Login page's Submit Button event handler.
If Membership.ValidateUser(user_name_register.Text, password_register.Text) Then
FormsAuthentication.RedirectFromLoginPage(user_name_register.Text, persistent_cookie_p_register.Checked)
End If
Any help would be greatly appreciated.