# Token from "getAccessTokenSilently" in frontend insecure?

**URL:** <https://community.auth0.com/t/token-from-getaccesstokensilently-in-frontend-insecure/135643>\
**Category:** JWT.io\
**Tags:** security, api\
**Created:** [June 4, 2024, 8:02pm UTC](https://community.auth0.com/t/token-from-getaccesstokensilently-in-frontend-insecure/135643 "2024-06-04T20:02:44Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![manuel.poelzl1](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@manuel.poelzl1](https://community.auth0.com/u/manuel.poelzl1)\
**Post date:** [June 4, 2024, 8:02pm UTC](https://community.auth0.com/t/token-from-getaccesstokensilently-in-frontend-insecure/135643/1 "2024-06-04T20:02:44Z")

</div>

Hi!

I have a question regarding the “correct” use of the “getAccessTokenSilently” function.

As I understand it, I get a token here and it is stored in memory and then read from it when it is needed. I am currently using my own Axios instance, which has an interceptor function and writes the token to the header. But theoretically this token could be intercepted by anyone in the frontend or not? I would therefore like to know what would be the best way to make the whole thing reasonably secure.

Sorry if this is the wrong subcategory!

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [June 4, 2024, 10:17pm UTC](https://community.auth0.com/t/token-from-getaccesstokensilently-in-frontend-insecure/135643/3 "2024-06-04T22:17:29Z")

</div>

Hey there @manuel.poelzl1!

> [@manuel.poelzl1](#):
>
> I am currently using my own Axios instance, which has an interceptor function and writes the token to the header. But theoretically this token could be intercepted by anyone in the frontend or not?

Assuming the Axios instance and general coding practices are secure, storing tokens in memory and utilizing HTTPS along with other [best practices](https://auth0.com/docs/secure/tokens/token-best-practices) provide a reasonable level of security.

---

<div class="post-metadata">

**Author:** ![manuel.poelzl1](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@manuel.poelzl1](https://community.auth0.com/u/manuel.poelzl1)\
**Post date:** [June 6, 2024, 4:33pm UTC](https://community.auth0.com/t/token-from-getaccesstokensilently-in-frontend-insecure/135643/4 "2024-06-06T16:33:31Z")

</div>

Thank you very much for your reply @ty.frith!  
But theoretically speaking, wouldn’t it be possible for someone to just add a breakpoint with the browser DevTools and then just execute the getAccessTokenSilently function?

This maybe Is a stupid question, but I just want to make sure.

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [June 6, 2024, 7:32pm UTC](https://community.auth0.com/t/token-from-getaccesstokensilently-in-frontend-insecure/135643/5 "2024-06-06T19:32:10Z")

</div>

Happy to help!

> [@manuel.poelzl1](#):
>
> But theoretically speaking, wouldn’t it be possible for someone to just add a breakpoint with the browser DevTools and then just execute the getAccessTokenSilently function?

I suppose they could, but it could only be invoked by an authenticated user within their own session.

---

<div class="post-metadata">

**Author:** ![manuel.poelzl1](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@manuel.poelzl1](https://community.auth0.com/u/manuel.poelzl1)\
**Post date:** [June 7, 2024, 8:29am UTC](https://community.auth0.com/t/token-from-getaccesstokensilently-in-frontend-insecure/135643/6 "2024-06-07T08:29:14Z")

</div>

That makes sense!  
Thank you very much for the explanation!

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [June 7, 2024, 2:46pm UTC](https://community.auth0.com/t/token-from-getaccesstokensilently-in-frontend-insecure/135643/7 "2024-06-07T14:46:27Z")

</div>

No problem, happy to help!

---

<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:** [June 21, 2024, 2:46pm UTC](https://community.auth0.com/t/token-from-getaccesstokensilently-in-frontend-insecure/135643/8 "2024-06-21T14:46:38Z")

</div>

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