# Security Concerns: How to refresh tokens?

**URL:** <https://community.auth0.com/t/security-concerns-how-to-refresh-tokens/7612>\
**Category:** Get Help\
**Tags:** security, tier1, refresh-tokens\
**Created:** [July 21, 2017, 3:17pm UTC](https://community.auth0.com/t/security-concerns-how-to-refresh-tokens/7612 "2017-07-21T15:17:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![amaurymartiny](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/amaurymartiny/32/1973_2.png) [@amaurymartiny](https://community.auth0.com/u/amaurymartiny)\
**Post date:** [July 21, 2017, 3:17pm UTC](https://community.auth0.com/t/security-concerns-how-to-refresh-tokens/7612/1 "2017-07-21T15:17:37Z")

</div>

I have 2 types of clients:

- SPA (I followed these docs: [Implicit Flow with Form Post - Auth0 Docs](https://auth0.com/docs/api-auth/grant/implicit) + Silent Authentication)
- Mobile Apps (I followed these docs: [Authorization Code Flow with Proof Key for Code Exchange (PKCE) - Auth0 Docs](https://auth0.com/docs/api-auth/grant/authorization-code-pkce))

In both cases, I don’t want the user to relogin (unless after 1 month of inactivity or so), similar behavior to Facebook.

I read the docs, and I understand how to use all Auth0 endpoints. However, I am concerned if they are really secure, and how Auth0 works behind the scenes. I’ll break down into 2 separate questions:

- For SPAs. I use implicit grants (=accessToken). No refresh tokens, I agree with that. But I don’t understand how Silent Authentication work. This access token I get back, it is short-lived, am I correct? Do I store it in the localStorage? Also, when calling the `renewAuth` endpoint, how can I be sure that it’s my client app that called it, not a hacker? Is the accessToken appended somewhere in that `renewAuth` request?

- For mobile apps. I understood that storing refreshTokens is secure enough. The problem comes with the communication between the server and the mobile app. I understood also how PCKE works. However, my question is: is I use a WebView, and use https (without ever using a custom protocol scheme), I don’t need to implement PCKE, is that correct? Secure communication is secured by SSL.

Thanks in advance.

---

<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:** [March 2, 2018, 5:55am UTC](https://community.auth0.com/t/security-concerns-how-to-refresh-tokens/7612/2 "2018-03-02T05:55:32Z")

</div>


