Wednesday, January 23, 2013

SharePoint 2013: "401 Not authorized" after setting up Forms Authentication custom signin page

I was working on a forms based authentication in SharePoint 2013. I configured web application to use forms authentication and set custom signin url. When I use the default sign in page, I get the login screen as soon as access the site and all is well so far.

Now, I changed Custom Sign in Page property for the authentication provider as shown below.

I created test.aspx as an application page inheriting from LayoutPageBase, and expected to see this login screen when site is accessed. But to my surprise, this is what I got to see.

So inspite of configuring everything correctly, the page is being loaded but as it is forms based authentication and due to the locatio of the page, page is not permitted to render. Here is the actual issue. When an application page is created, it is inherited from LayoutsPageBase, but when sign in page needs to be displayed it got to be one of the sigin page classes we have in
namespace. As soon as I changed the base class from LayoutsPageBase to FormsSignInPage class, I got the Custom Signin Page displayed as needed.

No comments:

Post a Comment