Skip to content
This repository was archived by the owner on Mar 16, 2025. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant