Author: jfkrueger | Posted on: 4/13/2009 11:46:58 AM | Views : 494

So here is my situation:



Authentication: Forms

Membership Provider: Active Directory


attributeMapUsername="sAMAccountName"

Role Provider: AzMan
If try to check if a user is in a specific role using the following two methods, I get an error:



User.IsInRole("RoleName")

Roles.IsUserInRole(User.Identity.Name, "RoleName")
This is the error that I get:

{"Exception has been thrown by the target of an invocation."} - {"The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))"}

 So I figured out that I can use this:



Roles.IsUserInRole(User.Identity.Name + "@mydomain.com", "RoleName")
and it works fine. The problem is that I am trying to use securityTrimmi ...

Go to the complete details ...