SPContext on Forms login page
-
10-12-2019 - |
Question
How can I get the SPContext
on the forms login page (/_forms/default.aspx)? Looking up SPContext.Current
or SPContext.GetContext(HttpContext.Current)
is always null. I need to retrieve the parent WebApplication and IIS Settings prior to logon in order to retrieve a Form Membership Provider within the SecurityTokenService
Application's web.config.
I'm open to alternatives to identifying the current Web Application and Zone in order to retrieve the Forms Membership Provider.
Solution
The MembershipProvider and RoleProvider classes provide the name (this.Name) of the membership/role provider.
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange