Questions tagged [msal-angular]

172 questions
13
votes
2 answers

MSAL Angular HTTP interceptor for localhost not attaching token

I'm trying to call a localhost API and to attach the bearer token on the header. It should be done by msal-angular automatically. For now, I have added the localhost API route to the protectedResourceMap but there is no bearer token inside the…
11
votes
1 answer

Error: The selector "app-redirect" did not match any elements, I am trying to upgrade to MSAL v2 and obtain refresh token

[Console error import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { SharedModule } from './shared/shared.module' import { AppRoutingModule } from './app-routing.module'; import {…
Abhishek Pal
  • 111
  • 1
  • 4
6
votes
3 answers

Ionic and MSAL Authentication

I have an Ionic app that needs to authenticate in Azure, so I installed MSAL following this tutorial: https://learn.microsoft.com/en-us/graph/tutorials/angular It works like a charm with "ionic serve" but when I run it in the device, it crashes when…
6
votes
2 answers

Angular APP_INITIALIZER in module not working properly

I have auth module which imports and sets msal configuration before app is initializer. I'm using APP_INITIALIZER to block the init of the app and get configuration for MSAL-ANGULAR. The issue is only with Firefox. The app is working perfectly fine…
Bozhinovski
  • 2,496
  • 3
  • 20
  • 38
5
votes
2 answers

BrowserAuthError: interaction_in_progress - Unable to fix, regardles of solutions found

I'm implementing security for the applications at the company I'm working at right now. I'm using @azure/msal-angular@2.0.2, @azure/msal-browser@2.16.1. I followed the example found here and got it working for the first application. I went on to…
4
votes
1 answer

How to redirect a user when the access token expires in MSAL for Angular?

I want to make sure that the user of a Single Page Application gets redirected back to the login page when the access token expires. As far as I understand MSAL automatically refreshes the access token after expiration. But it does so only when the…
MikhailRatner
  • 452
  • 6
  • 13
4
votes
2 answers

Angular MSAL (v2) login via redirect, redirecting 3 or more times before token acquisition

I have a Angular app (v11.2.0) that uses MSAL for authentication. I recently upgraded to v2 of the library (@azure/msal-angular - ^2.1.1, @azure/msal-browser - ^2.22.0), and it took some refactoring due to MSAL changes. It's mostly working as before…
Venator
  • 224
  • 3
  • 12
4
votes
1 answer

Angular web app with MSAL gives Cross-origin token redemption error

I am using MSAL with the angular web app. The application type is 'Web' in the Azure portal. When I try to login using single sign-on I am getting below error. Once the user logins to the app we have to display the username of the current…
Jan69
  • 1,109
  • 5
  • 25
  • 48
4
votes
1 answer

Fetch authorization code or refresh token for our API server

I'm having an Angular application that performs user authentication via Microsoft account. For this, I'm using the MSAL JS library which does work fine to authenticate the user. But we have the requirement where our backend server requires to call…
4
votes
2 answers

Use AD B2C and MSAL v2 with Angular allowing selective unprotected Web API calls

My goal is to allow users to freely browse an Angular 11+ site, reading data called from a .NET Web API as they navigate. Only users who wish to post data or access particular features would need to sign up and sign in, using AD B2C identity…
3
votes
3 answers

How to configure Angular v15.2 standalone application with MSAL

Before in ngModule base angular application you use to add MsalRedirectComponent in the bootstrap property of AppModule : bootstrap: [AppComponent, MsalRedirectComponent] Now in V15.2 the AppModule have been replace by the boostrapApplication…
Dadv
  • 324
  • 2
  • 17
3
votes
1 answer

Bypass the account selection screen while sign out(log out) @azure/msal-angular V2

I am using the @azure/msal-angular version 2 and Angular version 13. The scenario is when the user signed in to the application need to authorize the user if he doesn't have access need to sign out the user from the application. which will be…
3
votes
0 answers

MSAL in Angular - no_account_error: No account object provided to acquireTokenSilent

I've implemented an Azure AD login using the MSAL library on a Web App running Angular 11 and .NET Core 2.2. The login seems to work fine, but I couldn't find any reliable info on how to handle a 401 (unauthorized) HTTP error due to an expired…
Maxim
  • 227
  • 2
  • 14
3
votes
1 answer

Does the @azure/msal-angular package automatically refresh token?

I'm trying to move an existing angular 9 app from using an implicit flow with azure B2C to using the new auth code grant flow with PKCE. I'm using the @azure/msal-angular package and almost have it working. Just waiting on our identity management…
cobolstinks
  • 6,801
  • 16
  • 68
  • 97
3
votes
1 answer

MSAL v2 Angular Problem in Teams Desktop App

We are facing an AAD login issue for our web application (node.js + angular 10) in MS Teams Desktop & Mobile app while our users easily login by clicking a login button in any web browser or MS teams web client. In Angular, we are using two library…
1
2 3
11 12