TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Storing OpenId/OAuth2 refresh tokens?

1 pointsby adzicgalmost 5 years ago
Hi,<p>Need a bit of advice from someone who knows about OAuth&#x2F;OpenID security, since I&#x27;ve found a ton of conflicting advice online.<p>What&#x27;s the recommended way of storing refresh tokens for web apps?<p>It looks to me as if, for example, AWS Amplify is storing it in localStorage on the client, but isn&#x27;t that a bit defeating the point of refresh tokens? If the client knows both the ID token and refresh token, how is that more secure than just issuing ID tokens with longer expiry? localStorage is also readable by other scripts running in the same context, so extensions or XSS could steal the refresh token.<p>If you&#x27;re storing it server-side, what&#x27;s the recommended way of authorizing the client to refresh the token? does the client send the old ID token to the server and the server checks if that matches, or should the client somehow else prove that it has the right to get the new token?

no comments

no comments