Ability to override creation and validation of CSRF token #9176
jeffreyschultz
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
callbacksalready provided, that will allow developers to provide custom functions for handling creation and validation of tokens.Non-Goals
next-auth.Background
I am currently trying to allow multiple containers within a deployment to use the same
jwtandcsrftokens. The containers are a mix of multiple technologies where the others allow customization of these functions already, and I wish to do the same with thenext-auth-powerednextjsfrontends.Proposal
Make changes to the configuration objects to allow providing custom callbacks for handling creation and validation of
csrftokens. The existing handler code withinnext-authwill check to see if a callback has been provided, and if so, it will delegate the responsibility to the custom callbacks. If not, then the existing behavior will be used.Alternative
Replace the current
csrftoken implementation with one that can be validated against thesecret. This will allow sharing of thesecretacross containers, and independent validation thecsrftoken without the involvement of the other containers. The token payload could be anythingnext-authwants to use, but the important part for me is that it can be independently validated.Beta Was this translation helpful? Give feedback.
All reactions