# Which Authorization Server interactions affect Session Lifetime?

**URL:** <https://community.auth0.com/t/which-authorization-server-interactions-affect-session-lifetime/151601>\
**Category:** Get Help\
**Tags:** authentication-sessions, sessions\
**Created:** [November 15, 2024, 1:41pm UTC](https://community.auth0.com/t/which-authorization-server-interactions-affect-session-lifetime/151601 "2024-11-15T13:41:53Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![daniel.loiterton](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/daniel.loiterton/32/60687_2.png) [@daniel.loiterton](https://community.auth0.com/u/daniel.loiterton)\
**Post date:** [November 15, 2024, 1:41pm UTC](https://community.auth0.com/t/which-authorization-server-interactions-affect-session-lifetime/151601/1 "2024-11-15T13:41:53Z")

</div>

Ready to post? 🔍 First, try searching for your answer.  
In tenant advanced settings, we can adjust **Idle Session Lifetime** , described as:

> Timeframe (in minutes) after which a user’s session will expire if they haven’t interacted with the Authorization Server

So after a user signs into an app, are there any actions that will keep extending the session lifetime? It doesn’t seem like calling `getTokenSilently()` does.

For testing, I have set **Idle Session Lifetime** to 3 minutes. Every 20s or so, if the user is actively using the app, I make a call to getTokenSilently(), which sends a request to auth0 (not every time, since it is cached, but at least a couple of times - I can see it in the network tab). However, if I refresh the tab after 3 minutes post-login, silent authentication subsequently ALWAYS fails, which means login is required once more.

Is this expected behaviour or am I likely doing something wrong?

Ideally, while a user is actively using one of our apps, if they then refresh the page, or open one of our apps in another tab, auth0 should silently authenticate them so they don’t need to sign in again interactively.

I am using the `auth0-spa-js` sdk, with `useRefreshTokens` enabled.

---

<div class="post-metadata">

**Author:** ![dawid.matuszczyk](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dawid.matuszczyk/32/74550_2.png) [@dawid.matuszczyk](https://community.auth0.com/u/dawid.matuszczyk)\
**Post date:** [November 16, 2024, 12:43am UTC](https://community.auth0.com/t/which-authorization-server-interactions-affect-session-lifetime/151601/2 "2024-11-16T00:43:59Z")

</div>

Hi @daniel.loiterton,

Welcome back to the Auth0 Community!

Thank you for posting your question. Are you able to link this behavior to any error you see in the Auth0 Dashboard, like Failed Silent Auth or Failed Exchange?

Thanks  
Dawid

---

<div class="post-metadata">

**Author:** ![daniel.loiterton](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/daniel.loiterton/32/60687_2.png) [@daniel.loiterton](https://community.auth0.com/u/daniel.loiterton)\
**Post date:** [November 18, 2024, 9:46am UTC](https://community.auth0.com/t/which-authorization-server-interactions-affect-session-lifetime/151601/3 "2024-11-18T09:46:53Z")

</div>

Hi Dawid, yes I see `Failed Silent Auth: Login required` errors in the dashboard logs under these circumstances.

---

<div class="post-metadata">

**Author:** ![daniel.loiterton](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/daniel.loiterton/32/60687_2.png) [@daniel.loiterton](https://community.auth0.com/u/daniel.loiterton)\
**Post date:** [November 18, 2024, 12:07pm UTC](https://community.auth0.com/t/which-authorization-server-interactions-affect-session-lifetime/151601/4 "2024-11-18T12:07:34Z")

</div>

To expand on the above scenario:

Silent auth succeeds if:

1. I refresh the page (or open the app in another tab) within 3 minutes of signing in
2. I continue refreshing (or opening tabs) at intervals shorter than 3 minutes

But silent auth fails 3 minutes after this, even if I have subsequently refreshed the tokens with `getTokenSilently`

---

<div class="post-metadata">

**Author:** ![dawid.matuszczyk](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dawid.matuszczyk/32/74550_2.png) [@dawid.matuszczyk](https://community.auth0.com/u/dawid.matuszczyk)\
**Post date:** [November 18, 2024, 4:25pm UTC](https://community.auth0.com/t/which-authorization-server-interactions-affect-session-lifetime/151601/5 "2024-11-18T16:25:55Z")

</div>

Hi @daniel.loiterton

Thank you for the additional information. Based on this knowledge article → [Inactivity Timeout and Refresh Token Exchanges](https://community.auth0.com/t/inactivity-timeout-and-refresh-token-exchanges/134872)

> Interaction with the authorization server specifically refers to requests to `/authorize,` including silent authentication. Refresh token exchanges do not count as an interaction in this context. Therefore, the user session will not remain active if the only activity is refresh token exchanges.

To extend the session timeout, you’ll need to make a call to /authorize the endpoint with `prompt=none`.

Thanks  
Dawid

---

<div class="post-metadata">

**Author:** ![daniel.loiterton](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/daniel.loiterton/32/60687_2.png) [@daniel.loiterton](https://community.auth0.com/u/daniel.loiterton)\
**Post date:** [November 18, 2024, 9:41pm UTC](https://community.auth0.com/t/which-authorization-server-interactions-affect-session-lifetime/151601/6 "2024-11-18T21:41:58Z")

</div>

Great, thank you for clarifying. I was starting to come to that conclusion too.

Do you know if there is a function in the sdk that makes that particular call to the `/authorize` endpoint with `prompt=none`?

---

<div class="post-metadata">

**Author:** ![dawid.matuszczyk](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dawid.matuszczyk/32/74550_2.png) [@dawid.matuszczyk](https://community.auth0.com/u/dawid.matuszczyk)\
**Post date:** [November 18, 2024, 11:26pm UTC](https://community.auth0.com/t/which-authorization-server-interactions-affect-session-lifetime/151601/7 "2024-11-18T23:26:11Z")

</div>

Hi @daniel.loiterton

I believe there’s no direct function for prompt=none call, but you can override the parameters on the Auth0 SPA JS calls to add this param to the call to the Authorization Server.

> **[AuthorizationParams | @auth0/auth0-spa-js](https://auth0.github.io/auth0-spa-js/interfaces/AuthorizationParams.html#prompt)**
>
> Documentation for @auth0/auth0-spa-js

> **[Configure Silent Authentication](https://auth0.com/docs/authenticate/login/configure-silent-authentication)**
>
> Learn how to keep users logged in to your application using silent authentication.

> **[Configure Silent Authentication](https://auth0.com/docs/authenticate/login/configure-silent-authentication)**
>
> Learn how to keep users logged in to your application using silent authentication.

Thanks  
Dawid

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [December 2, 2024, 11:26pm UTC](https://community.auth0.com/t/which-authorization-server-interactions-affect-session-lifetime/151601/8 "2024-12-02T23:26:56Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
