Keeping a Simple OAuth Session Alive Membership

We use the Simple Memberhip Provider with ASP.NET MVC 4, and we use the Facebook client to support Facebook support (similar to http://www.asp.net/mvc/overview/getting-started/using-oauth-providers-with- mvc ).

We got this work, but the session always ends during the day, and we want the login to be permanent, so the user can log in and use this service only once.

In the original external ExternalLoginCallback function, I try to set the createPersistentCookie parameter to true, but it will not save the login in the active state. Here is the challenge I am making:

OAuthWebSecurity.Login(result.Provider, result.ProviderUserId, createPersistentCookie: true)

Do I need to configure a cookie to authenticate forms manually in order to perform a persistent login? Or is there another way to do this while still taking advantage of the built-in Facebook login feature?

+5
source share
1 answer

The ASPXAUTH cookie is used to authenticate the user. You can track the expiration time with firebug or any other web debugging tool. In your project, the cookie is set to ExternalLoginCallback. The following is an example of a cookie expiration time.

, , , SSL - cookie web.config. -, 1 . requireSSL true.

<authentication mode="Forms">
   <forms loginUrl="~/Account/Login" timeout="1" requireSSL="true"/>
</authentication>

, facebook ( 2 ). , , .

+3

All Articles