FoalTS / foal

Full-featured Node.js framework, with no complexity. 🚀 Simple and easy to use, TypeScript-based and well-documented.
https://foalts.org/
MIT License
1.88k stars 137 forks source link

feature request: support OAuth 2 PCKE code challenge #1014

Closed HRK44 closed 2 years ago

HRK44 commented 2 years ago

See https://www.oauth.com/oauth2-servers/pkce/authorization-request - New OAuth2 Twitter is using these fields, right now I'm passing them as custom params but I think it should be handled by default, any thought on that?

Would need to add code_verifier there https://github.com/FoalTS/foal/blob/e8a4611cb541059dbd6e8c0dddaf4351e7e697b9/packages/social/src/abstract-provider.service.ts#L242, something like that

Thanks!

LoicPoullain commented 2 years ago

Hi @HRK44 👋

The feature has been added to v2.9, as well as a social provider for Twitter. The version will be released soon.

To enable PKCE on a custom provider, you will need to set the property usePKCE to true.