Starts in:
1 DAY
22 HRS
7 MIN
16 SEC
Starts in:
1 D
22 H
7 M
16 S
Open Closed

Reducing the Remember Me time #5231


User avatar
0
ed_developer2 created

Hello, I am trying to reduce duration for which website remembers a user. Currently its set for ever we want to limit it to 1 hour, how can we do it. We tried this approach but didn't work. We tried to configure the authentication cookie in our host module. context.Services.ConfigureApplicationCookie(options => { options.ExpireTimeSpan = TimeSpan.FromSeconds(120); // Set the expiration time to 5 minutes options.SlidingExpiration = false; }); Can you please help me with this.


30 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Angular will auto login and get access token if API website has a user state. Then angular will use the access token to get data from API website.

    Do you wan to clear access token from angular when the browser exit?

  • User Avatar
    0
    ed_developer3 created

    As per your statement front end uses Access token and backend uses cookies now when we have set the duration of cookies to expire in 10 minutes then after 10 minutes when front end will ask api to give data then Cookie is expired then backend should redirect use to Login page. right so why its not happening then. Also we have disabled offline from scopes to be able to stop refresh tokens being generated by api. We will create new ticket for angular but upon cookie expiry uses should be redirected to login. let us know if we are wrong here and whats expected behaviour in this case.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Please set cookies and access token to 10 minutes, I will test it online again.

  • User Avatar
    0
    ed_developer2 created

    hello, Added please check.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Cookies 10 minutes:

    Access_Token 10 minutes

    Wait for 10 more minutes...

    Angular redirect to the login page.

Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06