I’m working in a React SPA connected to GitHub GraphQL API. I was working in my local until couple of days go, so I just generated an OAuth token for testing and coding in my environment. Now that I got the app finished, I’m trying to add proper authorization mechanism with auth0 to grant access to each GitHub user, but I can’t get it working properly.
I’ve followed these tutorials:
- Connect your app to GitHub
- React: Login
- Auth0 Extension: Custom Social Connections
- Call an Identity Provider API from the Frontend
- Add scopes/permissions to call Identity Provider’s APIs
- Call API Using Authorization Code Flow with PKCE
The whole process seems fine:
- My SPA requests proper auth access to GitHub with necessary scope mentioned on their docs
- The auth flow is completed successfully
- I call GitHub GraphQL API with the access token I got but it always says “bad credentials”
As I said, the GitHub GraphQL API connection works fine when I generate the OAuth token from my settings, so the connection to their API is fine. I followed all necessary steps for connecting to GitHub login, I don’t know if I’m missing something… Could anyone help me with this? Thanks!