401 unauthorized when log in with github account

Hi everyone,

I want to make a gist with my react js app. I log in with my github account by using auth0 and I get an access_token. But when I try to use this token to create gist with gist api, I get an error “Bad credentials” . I provided token in header but I still get unauthorized error. Can anyone tell me what am I missing? Thank you

Hi @aida108,

This post was moved to a different board that fits your topic of discussion a bit better. This means you’ll get better engagement on your post, and it keeps our Community organized so users can more easily find information.

As you’ll notice, your Topic is now in the How to use Git and GitHub board. No action is needed on your part; you can continue the conversation as normal here.

Let me know if you have any other questions or if I can help with anything else.


So you created a personal access token with the gist scope? You then used the OAuth token authentication system to create a Gist using the REST API? If so, then everything should be working. I would recommend double-checking what you did based on the help documents I linked above and see if there is anything you missed or have questions about. I would pay particular attention to the format of the header (the word “token” followed by a space is required).

Let us know if you have any other questions!

Hi everyone,

I am trying to create gist with my react js app. I log in with my github account and get access token back by using auth0. But when I create request for creating new gist with gists api, I get an error “Validation failed, missing field user.” 

I get user from user’profile from auth0 and pass it to request but I still get the same error. What is a problem. I also pass access token in header.

Can you give more details on how you’re going through this process? I linked to the documentation for this in your previous post and I don’t see a user field, so I’m not sure how you’re getting such an error. Please tell us exactly what you’re doing, step-by-step, what is happening and what you expect to happen.

Hi @aida108,

Just a heads up, this Topic had already been opened by you and is being discussed in another thread. In an effort to keep the Community Forum organized and make it easier for other users to find information, we ask that users continue the conversation in existing threads, instead of opening new ones about the same topic. For this reason, I’ve merged your newest Topic with the original Topic on this. 

Thank you again for being here!