I'm having a really frustrating error trying to secure an ASP.NET application using the WindowsTokenRoleProvider. For a particular user I'm seeing the following ProviderException thrown:
API failed due to error 'Catastrophic failure
As I said, this only seems to happen for a particuar user, I seem to be able to access the site fine and so have several colleagues. The only difference between us and the failing user is that they are not an administrator on the box where the site is being hosted.
From the call to GetRolesForUser. From the MSDN documentation it states that this can happen because of the following:
- The currently executing user does not have an authenticated WindowsIdentity attached to Page.User. For non-HTTP scenarios, the currently executing user does not have an authenticated WindowsIdentity attached to Thread.CurrentPrincipal.
- username does not match the Name of the current WindowsIdentity.
- A failure occurred while retrieving the user's Windows group information.
I'm suspecting the issue may be related to point 3 as I've managed to use the .NET Framework debugging ability in Visual Studio 2008 to debug the code and it seems to be failing calling:
UnsafeNativeMethods.GetGroupsForUser
What I can't understand is why! And if the call is failing in a Framework library then I'm not entirely sure what I can do to resolve the issue.
Any help or suggestions on this would be grately received as I'm at a loss as to where I go from here, I'm seriously considering scrapping using the role provider in place of some other less elegant method.