I'm using OWIN to authenticate with Facebook per: http://www.asp.net/mvc/tutorials/mvc-5/create-an-aspnet-mvc-5-app-with-facebook-and-google-oauth2-and-openid-sign-on
I want to be able to redirect to a specific login page when a user attempts to visit a page while they are unauthenticated.
As it stands, when I decorate an action with [Authorize]
, I get a 401 error from IIS.
If I was using Forms authentication, I would have this in my web.config:
<authentication>
<forms loginUrl="~/Account/Login" timeout="2880" />
</authentication>
Is there something similar I can do with OWIN, or do I need to create a custom Authorize attribute?