use otp as oauth2.password

This commit is contained in:
AJ ONeal 2017-01-18 04:31:00 -05:00
parent 268d12372d
commit 9bb628b2a7
1 changed files with 7 additions and 2 deletions

View File

@ -224,6 +224,13 @@
var type = 'access_token';
var grantType = 'password';
if (!passphrase) {
if (opts.otp) {
// for backwards compat
passphrase = opts.otp; // 'otp:' + opts.otpUuid + ':' + opts.otp;
}
}
var scope = opts.scope || directive.authn_scope;
var clientId = opts.appId;
var clientAgreeTos = opts.clientAgreeTos;
@ -232,8 +239,6 @@
var params = {
"grant_type": grantType
, "username": username
// ('otp:' + opts.otpUuid + ':' + opts.otp)) // for backwards compat?
// ('totp:' + opts.totp) // for backwards compat?
, "password": passphrase || undefined
, "totp": opts.totp || opts.totpToken || undefined
, "otp": opts.otp || opts.otpCode || undefined