# Control expires\_in value for SPA

**URL:** <https://community.auth0.com/t/control-expires-in-value-for-spa/66178>\
**Category:** Get Help\
**Tags:** spa, login, auth0\
**Created:** [July 14, 2021, 9:57pm UTC](https://community.auth0.com/t/control-expires-in-value-for-spa/66178 "2021-07-14T21:57:28Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gratus-BenchSci](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gratus-benchsci/32/22674_2.png) [@Gratus-BenchSci](https://community.auth0.com/u/Gratus-BenchSci)\
**Post date:** [July 14, 2021, 9:57pm UTC](https://community.auth0.com/t/control-expires-in-value-for-spa/66178/1 "2021-07-14T21:57:28Z")

</div>

I am using the universal login with an SPA set up - I am getting the following in my response after a success:  
`#access_token=xxxx&scope=openid%20email&expires_in=7200&token_type=Bearer&state=MDQkAvqN1rlY0w1yCcn9XX1f88ypm5Y1&id_token=xxxx`

How do I control the `expires_in` value?

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [July 14, 2021, 10:47pm UTC](https://community.auth0.com/t/control-expires-in-value-for-spa/66178/3 "2021-07-14T22:47:25Z")

</div>

Hi @Gratus-BenchSci,

Checkout this doc on token expiration:

> **[Update Access Token Lifetime](https://auth0.com/docs/secure/tokens/access-tokens/update-access-token-lifetime)**
>
> Describes how to update the access token lifetime for an API using the Auth0 Dashboard.

---

<div class="post-metadata">

**Author:** ![Gratus-BenchSci](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gratus-benchsci/32/22674_2.png) [@Gratus-BenchSci](https://community.auth0.com/u/Gratus-BenchSci)\
**Post date:** [July 15, 2021, 1:28pm UTC](https://community.auth0.com/t/control-expires-in-value-for-spa/66178/4 "2021-07-15T13:28:43Z")

</div>

Hi Dan,

I’ve read that part - but how do I associate an “API” to a “SPA” client?  
When I pick a machine-to-machine client, the API option is there - but for a SPA client that is no visible.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [July 15, 2021, 4:13pm UTC](https://community.auth0.com/t/control-expires-in-value-for-spa/66178/5 "2021-07-15T16:13:19Z")

</div>

When you add the _audience_ param to your token request you are associating with an API. Are you adding any audience to your request?

---

<div class="post-metadata">

**Author:** ![Gratus-BenchSci](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gratus-benchsci/32/22674_2.png) [@Gratus-BenchSci](https://community.auth0.com/u/Gratus-BenchSci)\
**Post date:** [July 15, 2021, 4:23pm UTC](https://community.auth0.com/t/control-expires-in-value-for-spa/66178/6 "2021-07-15T16:23:04Z")

</div>

I believe we are not. Thank you - let me try that out.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [July 15, 2021, 4:38pm UTC](https://community.auth0.com/t/control-expires-in-value-for-spa/66178/7 "2021-07-15T16:38:51Z")

</div>

Okay great. Let me know!

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [July 15, 2021, 7:00pm UTC](https://community.auth0.com/t/control-expires-in-value-for-spa/66178/8 "2021-07-15T19:00:53Z")

</div>

2 posts were split to a new topic: [Can you set the audience parameter in a rule?](https://community.auth0.com/t/can-you-set-the-audience-parameter-in-a-rule/66251)

---

<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:** [July 30, 2021, 7:00pm UTC](https://community.auth0.com/t/control-expires-in-value-for-spa/66178/9 "2021-07-30T19:00:54Z")

</div>

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