Search code examples
angularazure-active-directoryazure-ad-msalmsal-angular

Microsoft Authentication Library for Angular Session Detect Problem


I am working on Microsoft Authentication Library for Angular. but I am facing some problems the problem is my active directory session is available they don't detect the session and can't log in.


Solution

  • • I tried to implement an Angular application using Azure AD authentication based on the below Microsoft Documentation link: -

    https://learn.microsoft.com/en-us/azure/active-directory/develop/tutorial-v2-angular-auth-code

    It worked correctly and displayed the desired results. Please find the below screenshots for your reference of the application deployment and its execution: -

    Angular code module in VS code: - Angular app in VS code

    Execution in terminal: - Angular app execution

    Application output in the browser: -

    a) Before signing in Angular before signing in

    b) After signing in Angular app signing in

    c) Profile information retrieval: - Angular app output

    Thus, as you can refer above, the SSO also worked in my case for the angular application in my case. So, I would suggest you to please check the ‘app.module.ts’ file in your angular application ‘src\app’ directory to check whether all the required browser and MSAL authentication modules are imported or not. Also, please ensure that the correct application details are also embedded in the code so that redirection and session control mechanism work correctly and login is successful.