authentication-adal-pkg
Advanced tools
Comparing version 1.0.23 to 1.0.24
@@ -314,40 +314,47 @@ 'use strict'; | ||
// This prevents an additional prompt | ||
authContext.tokenCache.readItems().then(function(items) { | ||
if (items.length > 0) { | ||
var index = items.length - 1; | ||
authority = items[index].authority; | ||
initAuthenticationContext(constants.MOBILE); | ||
} | ||
// 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); | ||
} | ||
) | ||
.catch(err => { | ||
console.log(err); | ||
reject(err); | ||
}); | ||
}); | ||
authContext.tokenCache | ||
.readItems() | ||
.then(function(items) { | ||
if (items.length > 0) { | ||
var index = items.length - 1; | ||
authority = items[index].authority; | ||
initAuthenticationContext(constants.MOBILE); | ||
} | ||
// 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); | ||
} | ||
) | ||
.catch(function(err) { | ||
reject(err); | ||
}); | ||
}) | ||
.catch(function(err) { | ||
reject(err); | ||
}); | ||
}) | ||
.catch(err => { | ||
console.log(err); | ||
.catch(function(err) { | ||
reject(err); | ||
@@ -354,0 +361,0 @@ }); |
{ | ||
"name": "authentication-adal-pkg", | ||
"version": "1.0.23", | ||
"version": "1.0.24", | ||
"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
67590
2034