-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Passing custom state #4
Comments
I don't personally use this (I have a provider and not a client for passport) but this oauth2 library should support the state query parameter. I'm also surprised this doesn't support it. It doesn't look like the openid client strategy doesn't either. |
I have dug deeper, and actually it is possible to send a custom state parameter back and verify it again, but it happens on the server side. So in the end, we had to implement a temporary store for these tokens, but we are able to transfer state from the client. It works something like this:
In the end, it's a bit convoluted, but it works as a mechanism to pass state through the request from end to end. It would still be nice if the |
I'll be happy to review a PR which implements this, it's not something I'd use personally at the moment so it's best if someone else implements it that's actually going to use it since they'll be able to work out the kinks. @adamreisnz feel free to go at it! This repo hasn't been updated to use eslint yet so I'll do that asap so we don't need to deal with conflicts later. #5 |
Thanks, if we'll still end up needing this I'll give it a go. |
I've linted the code so feel free to make a PR if you need it. |
Hi, there is some kind of
state
implementation which relies on a store of some sort, but I'm wondering if we can add support for a customstate
string, that we can choose to send from the app and which then will be returned again in the query string parameters when the request returns from the oAuth provider.As we have a multi tenanted app, we require it to identify which of the accounts the user is trying to authenticate to (they can be member of more than one). We use the state parameter for that in most other integrations, so I was surprised to see that this doesn't appear to be supported by passport-oauth2.
Any thoughts?
The text was updated successfully, but these errors were encountered: