Integrating passport-github and node-github

I'm using passport-github to allow users to authenticate in my app using Github OAuth. I save the access token to DB so I can use it later.

Now I'm trying to use node-github to make some API calls, but there is no way I can get it to authenticate. User and password authentication is not an option, since I'm trying to avoid the user having to authenticate every time, and the other methods (there are four auth methods according to the README) do not work (or at least I'm unable to make them work).

Here is some of the relevant code:

exports.create = function( req, res ) {

var project = new Project( req.body );
project.user = req.user;

var token = req.user.providerData.refreshToken.access_token; //Token gotten from passport-github

var GitHubApi = require( 'github' );

var github = new GitHubApi( {
    // required
    version:    '3.0.0',
    // optional
    debug:      true,
    protocol:   'https',
    pathPrefix: '/api/v3', // for some GHEs
    timeout:    5000
} );

github.authenticate( {
    type:  'oauth',
    token: token
} );

github.repos.create(
    {
        headers:     {},
        name:        project.githubRepoUrl,
        description: project.description,
        private:     project.isPrivate,
        auto_init:   true
    },
    function( err, res ) {
        if( err ) {
            console.log( err );
        }

        if( res ) {
            console.log( 'Created repo with id: ' + res.id + 'and name: ' + res.name )
        }
    }
);

Relevant console output:

REQUEST:  { host: 'api.github.com',
port: 443,
path: '/api/v3/user/repos?access_token=3488bfe013e9c071f9af5a45bda8f8bcd23c7d5a',
method: 'post',
headers: 
   { host: 'api.github.com',
     'content-length': 72,
     'content-type': 'application/json; charset=utf-8',
     'user-agent': 'NodeJS HTTP Client',
     accept: 'application/vnd.github.beta+json' } }
REQUEST BODY: {"name":"sdfdsf","description":"dsfds","private":false,"auto_init":true}

STATUS: 401
HEADERS: {"server":"GitHub.com","date":"Sun, 03 Aug 2014 04:22:04 GMT","content-type":"application/json; charset=utf-8","status":"401 Unauthorized","x-github-media-type":"github.beta; format=json","x-ratelimit-limit":"60","x-ratelimit-remaining":"59","x-ratelimit-reset":"1407043324","x-xss-protection":"1; mode=block","x-frame-options":"deny","content-security-policy":"default-src 'none'","content-length":"83","access-control-allow-credentials":"true","access-control-expose-headers":"ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval","access-control-allow-origin":"*","x-github-request-id":"40E45687:2B9A:596F677:53DDB8EC","strict-transport-security":"max-age=31536000; includeSubdomains","x-content-type-options":"nosniff"}
[error] { [Error: {"message":"Bad credentials","documentation_url":"https://developer.github.com/v3"}]
[error]   message: '{"message":"Bad credentials","documentation_url":"https://developer.github.com/v3"}',
[error]   code: 401 } null undefined
{ [Error: {"message":"Bad credentials","documentation_url":"https://developer.github.com/v3"}]
message: '{"message":"Bad credentials","documentation_url":"https://developer.github.com/v3"}',
code: 401 }

Does someone have done this before? Is there any tutorial on this?