authentication-adal-pkg
Advanced tools
Comparing version 1.0.25 to 1.0.26
@@ -78,3 +78,4 @@ 'use strict'; | ||
var loginResource = null; | ||
var clientId = null; | ||
var clientIdNative = null; | ||
var clientIdWeb = null; | ||
var userId = null; | ||
@@ -96,3 +97,4 @@ var authenticationResult = null; | ||
resourceUri = config.resourceUri; | ||
clientId = config.clientId; | ||
clientIdWeb = config.clientIdWeb; | ||
clientIdNative = config.clientIdNative; | ||
userId = config.userId; | ||
@@ -106,3 +108,3 @@ loginResource = config.loginResource; | ||
tenant: tenant, | ||
clientId: clientId, | ||
clientIdNative: clientIdNativeWeb, | ||
redirectUri: redirectUriWeb, | ||
@@ -195,3 +197,3 @@ loginResource: loginResource | ||
} | ||
auth.acquireTokenPopup(clientId, null, null, acquireTokenCallback); | ||
auth.acquireTokenPopup(clientIdWeb, null, null, acquireTokenCallback); | ||
} else { | ||
@@ -228,3 +230,3 @@ resolve(token); | ||
}; | ||
auth.acquireToken(clientId, acquireTokenCallback); | ||
auth.acquireToken(clientIdWeb, acquireTokenCallback); | ||
} else { | ||
@@ -298,3 +300,3 @@ resolve(token); | ||
authContext | ||
.acquireTokenAsync(resourceUri, clientId, platformRedirectUri) | ||
.acquireTokenAsync(resourceUri, clientIdNative, platformRedirectUri) | ||
.then(function(authResult) { | ||
@@ -326,23 +328,29 @@ var token = authResult.accessToken; | ||
// Attempt to authorize user silently | ||
authContext.acquireTokenSilentAsync(resourceUri, clientId, userId).then( | ||
function(authResult) { | ||
var token = authResult.accessToken; | ||
var exp = new Date(authResult.expiresOn).getTime(); | ||
storeToken(token, exp); | ||
resolve(authResult); | ||
}, | ||
function() { | ||
// We require user credentials so triggers authentication dialog | ||
// acquireTokenAsyncMobile(resolve, reject); | ||
authContext | ||
.acquireTokenAsync(resourceUri, clientId, platformRedirectUri) | ||
.then(function(authResult) { | ||
var token = authResult.accessToken; | ||
var exp = new Date(authResult.expiresOn).getTime(); | ||
var token = authResult.accessToken; | ||
storeToken(token, exp); | ||
resolve(authResult); | ||
}, reject); | ||
} | ||
); | ||
authContext | ||
.acquireTokenSilentAsync(resourceUri, clientIdNative, userId) | ||
.then( | ||
function(authResult) { | ||
var token = authResult.accessToken; | ||
var exp = new Date(authResult.expiresOn).getTime(); | ||
storeToken(token, exp); | ||
resolve(authResult); | ||
}, | ||
function() { | ||
// We require user credentials so triggers authentication dialog | ||
// acquireTokenAsyncMobile(resolve, reject); | ||
authContext | ||
.acquireTokenAsync( | ||
resourceUri, | ||
clientIdNative, | ||
platformRedirectUri | ||
) | ||
.then(function(authResult) { | ||
var token = authResult.accessToken; | ||
var exp = new Date(authResult.expiresOn).getTime(); | ||
var token = authResult.accessToken; | ||
storeToken(token, exp); | ||
resolve(authResult); | ||
}, reject); | ||
} | ||
); | ||
}, reject); | ||
@@ -349,0 +357,0 @@ }, reject); |
{ | ||
"name": "authentication-adal-pkg", | ||
"version": "1.0.25", | ||
"version": "1.0.26", | ||
"description": "An authentication SDK based on MS ADAL ", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
67337
2024