TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Storing OpenId/OAuth2 refresh tokens?

1 点作者 adzicg将近 5 年前
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?

暂无评论

暂无评论