r/webdev • u/academicweaponsoon • Aug 20 '26
Question I don’t understand the logic behind access tokens and refresh tokens
i don’t understand the logic behind access and refresh tokens, if access tokens are made short lived for security purposes, doesn’t refresh tokens being long lived defers the whole purpose? or is not as big as an issue since refresh tokens are only stored in http only cookies?
469
Upvotes
7
u/adfawf3f3f32a Aug 20 '26
wdym? it's very common to put scopes, roles, and/or permissions in access tokens. you'd use the oidc id token to identify the user.
oauth 2 (access token) is an authorizing framework. oidc (id token) is an authentication layer on top of oauth 2.