Skip to content

Instantly share code, notes, and snippets.

@gblmarquez
Created June 18, 2015 00:58
Show Gist options
  • Save gblmarquez/dd23213a5afc1fe0f854 to your computer and use it in GitHub Desktop.
Save gblmarquez/dd23213a5afc1fe0f854 to your computer and use it in GitHub Desktop.
test oauth2 with resource owner
var oauth2 = require('./lib/simple-oauth2.js')({
clientID: 'roclient',
clientSecret: 'secret',
site: 'http://id.conube.com.br',
tokenPath: '/connect/token'
});
var request, result, error;
var params = {
'username': '[email protected]',
'password': '123123',
'grant_type': 'password',
'scope': 'openid email profile abrir_empresa:user'
};
oauth2.password.getToken(params, function(e, r) {
error = e;
result = r;
console.log(r, e);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment