MSAL 2.0 not retrieving token
I've set up a few Angular apps using msal-angular and msal-browser and on my most recent app, I am running into an issue where I am no longer getting back a token. I get the log message: @azure/msal-common@12.1.0 : Info - CacheManager:getIdToken - No token found
I've confirmed that my tenantID and clientID are accurate. The Azure authentication and redirect URL's are set up correctly. I basically have this app set up no differently then my other apps that have no issue logging in and retrieving a token.
I've tried retrieving the token using the ACQUIRE_TOKEN_SUCCESS like I do with my other apps, but it does not hit that subscription.
I am using Angular 15.1.2 (tried v14 as well) and azure/msal-angular 2.5.5 and azure/msal-browser 2.36.0. I am using MsalGuard on my route.
I've tried creating a fresh angular project with just MSAL related code and ran into the same issue. When I use this projects ClientID and TenantID in another project (that works with msal), it's able to log in and retrieve the token so there must be something wrong with my current code.
App.module.ts
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import {
MsalBroadcastService,
MsalGuard,
MsalGuardConfiguration,
MsalInterceptor,
MsalInterceptorConfiguration,
MsalModule,
MsalRedirectComponent,
MsalService,
MSAL_GUARD_CONFIG,
MSAL_INSTANCE,
MSAL_INTERCEPTOR_CONFIG,
} from '@azure/msal-angular';
import {
BrowserCacheLocation,
InteractionType,
IPublicClientApplication,
LogLevel,
PublicClientApplication,
} from '@azure/msal-browser';
import { environment } from '../environments/environment';
import { HTTP_INTERCEPTORS } from '@angular/common/http';
import { HttpClientModule } from '@angular/common/http';
import { TestComponent } from './components/test/test.component';
const isIE =
window.navigator.userAgent.indexOf('MSIE ') > -1 ||
window.navigator.userAgent.indexOf('Trident/') > -1;
export function loggerCallback(logLevel: LogLevel, message: string) {
console.log(message);
}
export function MSALInstanceFactory(): IPublicClientApplication {
return new PublicClientApplication({
auth: {
clientId: environment.clientId,
authority: 'https://login.microsoftonline.com/' + environment.tenantId,
redirectUri: environment.appUrl,
postLogoutRedirectUri: '/',
},
cache: {
cacheLocation: BrowserCacheLocation.LocalStorage,
storeAuthStateInCookie: isIE, // set to true for IE 11. Remove this line to use Angular Universal
},
system: {
loggerOptions: {
loggerCallback,
logLevel: LogLevel.Info,
piiLoggingEnabled: false,
},
},
});
}
export function MSALInterceptorConfigFactory(): MsalInterceptorConfiguration {
const protectedResourceMap = new Map