Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

authentication-adal-pkg

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

authentication-adal-pkg - npm Package Compare versions

Comparing version 1.0.24 to 1.0.25

86

lib/index.js

@@ -308,55 +308,37 @@ 'use strict';

// Check if MS ADAL cordova library is installed
Microsoft.ADAL.AuthenticationSettings.setUseBroker(true)
.then(function() {
initAuthenticationContext(constants.MOBILE);
setPlatformRedirectUri(getPlatform());
// Check if token already exist. If so, take the tenant where the token came from.
// 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
Microsoft.ADAL.AuthenticationSettings.setUseBroker(true).then(function() {
initAuthenticationContext(constants.MOBILE);
setPlatformRedirectUri(getPlatform());
// Check if token already exist. If so, take the tenant where the token came from.
// 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
.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(function(err) {
reject(err);
});
.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);
}
);
}, reject);
}, reject);
};

@@ -363,0 +345,0 @@ var authenticateBrowser = function authenticateBrowser(resolve, reject) {

{
"name": "authentication-adal-pkg",
"version": "1.0.24",
"version": "1.0.25",
"description": "An authentication SDK based on MS ADAL ",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc