Refreshing tokens with both gitlab and github as authentication providers #1670
Replies: 2 comments 10 replies
-
With only using cookies, it might be hard to support multiple providers, as we have a limit of 4096 bytes in cookie size in most browsers. I was playing with the thought of splitting cookies when they near this limit, but I don't have a clear solution yet. A /token endpoint would help #951 once it is implemented correctly, we could persist tokens in the database and do the rotation for you for multiple providers. Unfortunately, it looks like that this is not likely to be implemented very soon. |
Beta Was this translation helpful? Give feedback.
-
You don't need to implement token rotation with Github OAuth, the token does not expire although the person who authorized the OAuth app can revoke the token. I think it's the same with Gitlab not 100% sure, they do provide a refresh token in case you want to refresh ... |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there,
https://next-auth.js.org/tutorials/refresh-token-rotation I have referred to this article but I am still left with doubts on how should I implement refresh token rotation when both my providers are github and gitlab. I have seen the documentation from github indicating that to obtain refresh token, I first need to migrate my github oAuth app to github app. For gitlab, they do provide a refresh token but it does not have an expiry time attached to it. I am lost as to what I should do next, should I just ignore token rotation or find a way to make the whole token refresh thing work.
Beta Was this translation helpful? Give feedback.
All reactions