adjust loginCode and resourceOwnerPassword

This commit is contained in:
AJ ONeal 2017-01-18 04:26:49 -05:00
parent 3d199e6516
commit 268d12372d
1 changed files with 5 additions and 3 deletions

View File

@ -169,7 +169,7 @@
return result; return result;
}; };
core.loginCode = function (directive, username, opts) { core.loginCode = function (directive, opts) {
// //
// Example Resource Owner Password Request // Example Resource Owner Password Request
// (generally for 1st party and direct-partner mobile apps, and webapps) // (generally for 1st party and direct-partner mobile apps, and webapps)
@ -183,7 +183,7 @@
var args = directive.otp; var args = directive.otp;
var params = { var params = {
"username": username || opts.id || opts.username "username": opts.id || opts.username
, "request_otp": true // opts.requestOtp || undefined , "request_otp": true // opts.requestOtp || undefined
//, "jwt": opts.jwt // TODO sign a proof //, "jwt": opts.jwt // TODO sign a proof
}; };
@ -232,7 +232,9 @@
var params = { var params = {
"grant_type": grantType "grant_type": grantType
, "username": username , "username": username
, "password": (opts.otpUuid && (opts.otpUuid + ':') || '') + passphrase // might be otpCode // ('otp:' + opts.otpUuid + ':' + opts.otp)) // for backwards compat?
// ('totp:' + opts.totp) // for backwards compat?
, "password": passphrase || undefined
, "totp": opts.totp || opts.totpToken || undefined , "totp": opts.totp || opts.totpToken || undefined
, "otp": opts.otp || opts.otpCode || undefined , "otp": opts.otp || opts.otpCode || undefined
, "otp_uuid": opts.otpUuid || undefined , "otp_uuid": opts.otpUuid || undefined