Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Does PKCE i.e. options state: true the use as a serverless server? #134

Open
Superlokkus opened this issue Jan 7, 2021 · 1 comment
Open

Comments

@Superlokkus
Copy link

I am using this passport strategy on a serverless platform with the authentication code flow, and to improve security I was considering using the PKCE flow extension. As several issues and the project itself suggests, these options are not documented.

However by reading the code I can see that I seem to be able to add pkce: true in the options object, however the strategy constructor complains that "OAuth2Strategy requires state: true option when PKCE is enabled" . So naturally I am inclined to also add the undocumented ( #28 ) state option, but as far as I can tell, i.e. it's name suggests, or the unmerged PR !93 suggests, this would need to store a state on the server between authorization start and callback.

Since I can not make sure which server, holding different states, gets the callback by de# a server less environment, this implies PKCE is not supported in serverless environments?

@james-hu
Copy link

"this implies PKCE is not supported in serverless environments" - this is my understanding. And the workaround is to use a ElastiCache/Redis session store or DynamoDB session store together with the Lambda if you are using AWS.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants