Created
June 18, 2015 00:58
-
-
Save gblmarquez/dd23213a5afc1fe0f854 to your computer and use it in GitHub Desktop.
test oauth2 with resource owner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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