angularjs - Adal Infinite redirection + Edge + Trusted sites -


background: have single page app (built using angular) uses adal , adal-angular authenticate against azure active directory. have been using version 1.0.7 of adal , adal-angular (tried using 1.0.14 still no luck) , ui-router routing.

issue: few of our users getting continuous authentication loop while trying access web application on edge browser specifically. note works fine ie, chrome , firefox. surprisingly works fine when edge opened in inprivate window. issue device specific, user specific , occurs in edge.

workaround: when site added trusted sites (via control panel -> internet options), authentication loop issue resolved , works seamlessly.

any idea why happening? i’m assuming of it’s cookie issue when adal writes auth cookie site , edge can’t seem read it?

also suggestions better fix/workaround this? can’t tell users go , add website trusted sites collection.

code snippet of app.js:

function authenticationinit(adalauthenticationserviceprovider, $httpprovider, $locationprovider) { $locationprovider.html5mode(false); var endpoints = { // map location of request api identifier of associated resource "endpointkey": window.config.aadendpointurl, "endpointvalue": window.config.aadresouceidurl };     adalauthenticationserviceprovider.init(               {                   instance: window.config.aadauthenticationinstance,                   tenant: window.config.tenant,                   clientid: window.config.clientid,                   extraqueryparameter: 'nux=1',                   endpoints: endpoints               }, $httpprovider); }   function registerroutes($stateprovider) {      $stateprovider         .state('home', {             templateurl: getviewurl('widgets'),             controller: 'widgetscontroller',             controlleras: 'widget',             url: '/dashboard'         })          .state('terms',         {             templateurl: getviewurl('terms'),             controller: 'termscontroller',             controlleras: 'terms',             url: '/terms'         }) }   $rootscope.$on('$locationchangestart', function (e) { if (adalauthenticationservice.userinfo.isauthenticated == false) { // executed during first time login , token expiration adalauthenticationservice.login(); } });   $rootscope.$on("adal:loginsuccess", function (e) { // executed after aad authentication successful navigationfactory.navigateto('home'); }); 

have raised same query here- https://github.com/azuread/azure-activedirectory-library-for-js/issues/537

adal uses localstorage save tokens , reads data later on (you have option change session storage). point if adal not able write local storage, not tokens. there setting in microsoft edge lets websites store data. enable this, go to: settings>advanced settings , enable: 'let sites save protected media license on device'. hope fixes issue.


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -