- http://oauth.googlecode.com/svn/spec/ext/session/1.0/drafts/1/spec.html#anchor4
- https://developer.yahoo.com/oauth/guide/oauth-refreshaccesstoken.html
###Example usage RefreshTokenOA2 ###Este servicio hace un request para refrescar tokens hacia la url indicada en el parámetro uri.
var opts = {
form: {
grant_type: 'refresh_token',
client_id: '...',
client_secret: '...',
refresh_token: '...'
},
json: true
},
uri = 'http://service-oauth.com/refreshtoken';
sso.RefreshTokenOA2(uri, opts, function (err, result, info){
//
})
###Example usage getTokenURL ###Este servicio hace un request con parámetros indicados como ejemplo
var opts = {
method: 'PUT',
preambleCRLF: true,
postambleCRLF: true,
uri: 'http://service.com/upload',
// Headers
headers: {
'User-Agent': 'request'
},
// Agent options
agentOptions: {
//Cretificados
cert: fs.readFileSync(certFile),
key: fs.readFileSync(keyFile),
passphrase: 'password',
securityOptions: 'SSL_OP_NO_SSLv3'
},
// Enviar multiparte
multipart: [
{
'content-type': 'application/json',
body: JSON.stringify({foo: 'bar', _attachments: {'message.txt': {follows: true, length: 18, 'content_type': 'text/plain' }}})
},
{ body: 'I am an attachment' },
{ body: fs.createReadStream('image.png') }
],
// Multiparte con opciones adicionales
multipart: {
chunked: false,
data: [
{
'content-type': 'application/json',
body: JSON.stringify({foo: 'bar', _attachments: {'message.txt': {follows: true, length: 18, 'content_type': 'text/plain' }}})
},
{ body: 'I am an attachment' }
]
}
}
sso.getTokenURL(opts, function (err, result, info){
//
})