Avatar of Steve Hougom
Steve Hougom
Flag for United States of America asked on

msaljs-browser azure login issue

Hello.  I have a html page that loads msal js for the browser and it finds the username in Azure directory but does like a double sign in and is acting strange.  Im looking for a minimalist approach here and the sample msdn provides for Auth code flow is maybe more than I need.  So im trying to find something clean and lean that doesnt do a double hop like this does.  Code posted below.  This is all assuming my registrations are correct of course.  

The html file is attached and the code begins on line 104.


index.html
* azure active directoryJavaScriptAzure

Avatar of undefined
Last Comment
Steve Hougom

8/22/2022 - Mon
Steve Hougom

ASKER
Registration file in azure if it helps is also attached.

gopack reg.PNG
Steve Hougom

ASKER
Found a solution here.  The key is get the login code out of the html and inside separate JS files.  Nice clean sample here.

microsoft-authentication-library-for-js/samples/msal-browser-samples/VanillaJSTestApp2.0/app/b2c at dev · AzureAD/microsoft-authentication-library-for-js (github.com) 
ASKER CERTIFIED SOLUTION
Steve Hougom

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23