Skip to content
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

Add getTokenRequestWithAuthCodeFlow API for completing OAuth server-side #144

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

danReynolds
Copy link

Certain Oauth providers like https://developers.facebook.com/docs/instagram-basic-display-api/getting-started among others require that a client secret be included in the Oauth handoff to exchange the auth code for the access token. This library supports passing a client secret, but client secrets are fundamentally unsafe on mobile clients as described here: https://developer.okta.com/blog/2019/01/22/oauth-api-keys-arent-safe-in-mobile-apps and a PKCE flow should be used.

Since some Oauth providers are slow to adopt PKCE support, instead what we can do is support going through the Oauth redirect handoff on the client, receiving the auth code and then sending that data to a secure server which can then finish the Oauth flow and retrieve the access token using the client secret.

This change adds support for a getTokenRequestWithAuthCodeFlow API which goes through that process and returns all the data your server will need to complete the flow.

Let me know if that makes sense and if there are any fundamental security or implementation issues with this approach and I'm happy to iterate on it.

Thanks.

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

Successfully merging this pull request may close these issues.

1 participant