I’m currently working on a React application where I’m integrating Auth0 for authentication, including GitHub login. I want users to log in via GitHub and then display their repositories on the home screen by fetching them from the GitHub API.
Problem:
The access token is being successfully generated when I authenticate via GitHub, but when I attempt to fetch the repositories using the token, I get a 401 Unauthorized error from the GitHub API.
Upon verifying the github token in jwt.io it seems that token signature is invalid.
Auth0 Settings:
I’ve configured the GitHub connection in Auth0 to use repo scope.
GitHub Developer Settings:
The GitHub OAuth App is set up with the correct Client ID and Client Secret in Auth0. The OAuth app is requesting the repo scope and is registered in the GitHub Developer settings.
Questions:
Why is the GitHub API returning a 401 Unauthorized when the access token seems to be generated correctly?
Are there any additional settings I need to configure in Auth0 or GitHub to ensure the repo scope is included in the access token?
please refer to this repository for code - GitHub - Sourish2003/react_app