# HTTP interceptor make a request to /authorize every API call

**URL:** <https://community.auth0.com/t/http-interceptor-make-a-request-to-authorize-every-api-call/60185>\
**Category:** Get Help\
**Tags:** auth0-angular\
**Created:** [March 27, 2021, 7:36pm UTC](https://community.auth0.com/t/http-interceptor-make-a-request-to-authorize-every-api-call/60185 "2021-03-27T19:36:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bart3](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/bart3/32/25619_2.png) [@bart3](https://community.auth0.com/u/bart3)\
**Post date:** [March 27, 2021, 7:36pm UTC](https://community.auth0.com/t/http-interceptor-make-a-request-to-authorize-every-api-call/60185/1 "2021-03-27T19:36:47Z")

</div>

Hi,

I am using the auth0-angular SDK and the AuthHttpInterceptor to inject access tokens into the authorization header for making API calls. Why does the interceptor call into /authorize for every API call I make? I did not disable any caching, using pretty much the defaults. Why does it generate a new access token every time?

Regards,  
Bart

---

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [March 31, 2021, 7:05pm UTC](https://community.auth0.com/t/http-interceptor-make-a-request-to-authorize-every-api-call/60185/3 "2021-03-31T19:05:58Z")

</div>

Hi @bart3,

Welcome to the Community!

A request to the `/authorize` endpoint will be made if a token is not found in the cache. Are you seeing this happen with each page refresh, or does this occur even without a page refresh?

Here is more info about token storage in SPAs:

[https://auth0.com/docs/tokens/token-storage#browser-in-memory-scenarios](https://auth0.com/docs/tokens/token-storage#browser-in-memory-scenarios)

---

<div class="post-metadata">

**Author:** ![bart3](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/bart3/32/25619_2.png) [@bart3](https://community.auth0.com/u/bart3)\
**Post date:** [April 1, 2021, 8:08am UTC](https://community.auth0.com/t/http-interceptor-make-a-request-to-authorize-every-api-call/60185/4 "2021-04-01T08:08:18Z")

</div>

The problem occurred without page refresh. I was making API calls every 1s and each was getting authorized with a new token.

The issue I had was resolved when ID Token expiry was increased from 60s to 15min. Access token expiry was also set to a much larger value. Looks like there is some bug-ish behaviour in the SDK.

Regards,  
Bart

---

<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:** [April 16, 2021, 8:08am UTC](https://community.auth0.com/t/http-interceptor-make-a-request-to-authorize-every-api-call/60185/5 "2021-04-16T08:08:38Z")

</div>

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