title: Why do I get a 404 response when I try to post to github API whilst authenticated with oauth access tokens?
body: <p>I am using the passportjs library to authenticate users into the application. An access token is usually generated when users authenticate successfully with passportjs. I am attempting to create a branch with the github API with this access token but without much success, both using the octokit wrapper as well as posting with super-agent. </p>
  
  <p>I first attempted to authenticate the octokit by providing it username and password, in this fashion. </p>
  
  <pre><code>let octokit=new Octokit({
    auth:{
      username:username,
      password:password
    }
  });
  </code></pre>
  
  <p>I was then able to create a ref/branch without much issue. However, when I did the same but with accesstokens generated by github SSO, like this</p>
  
  <pre><code>passport.use(new GitHubStrategy({
                  clientID: keys.clientId,
                  clientSecret: keys.clientSecret,
                  callbackURL: "/auth/github/callback"
              },
              async (accessToken, refreshToken, profile, done) =&gt; {
                  let octokit = new Octokit(auth: `token ${accessToken}`);
                  const branchName = 'refs/heads/vue' + Math.random();
                  let masterHash = '123x123x1231232';
                  octokit.git.createRef({
                      owner: owner,
                      repo: 'gitDemo',
                      ref: branchName,
                      sha: masterHash
                  }).then((data) =&gt; {
                      console.log('data ', data);
                  });
  
              }
  </code></pre>
  
  <p>I receive an HttpError: Not found error. Another method that I tried is to post directly to the end point with superagent, putting the acccess code in the authorization header. </p>
  
  <pre><code>  const data={
            ref:'refs/heads/FooBranch',
            sha:masterHash
        };
  const res2=await request.post('https://api.github.com/repos/SomeOwner/SomeRepo/git/refs')
                              .set('Authorization','token '+accessToken)
                              .send(data);
  </code></pre>
  
  <p>However, I still receive an HttpError :not found issue. I am quite confused as to what I may have done wrong. Thank you and any help would be greatly appreciated!</p>