@azure/msal-angular 4.0.24 → 5.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/IMsalService.d.ts +16 -17
  2. package/README.md +3 -1
  3. package/constants.d.ts +9 -5
  4. package/{fesm2020 → fesm2022}/azure-msal-angular.mjs +757 -734
  5. package/fesm2022/azure-msal-angular.mjs.map +1 -0
  6. package/index.d.ts +5 -5
  7. package/msal.broadcast.config.d.ts +3 -3
  8. package/msal.broadcast.service.d.ts +19 -19
  9. package/msal.guard.config.d.ts +9 -9
  10. package/msal.guard.d.ts +43 -43
  11. package/msal.interceptor.config.d.ts +13 -13
  12. package/msal.interceptor.d.ts +76 -70
  13. package/msal.module.d.ts +13 -13
  14. package/msal.navigation.client.d.ts +19 -19
  15. package/msal.redirect.component.d.ts +15 -15
  16. package/msal.service.d.ts +32 -33
  17. package/package.json +5 -15
  18. package/packageMetadata.d.ts +2 -2
  19. package/public-api.d.ts +17 -17
  20. package/esm2020/IMsalService.mjs +0 -6
  21. package/esm2020/azure-msal-angular.mjs +0 -5
  22. package/esm2020/constants.mjs +0 -10
  23. package/esm2020/msal.broadcast.config.mjs +0 -6
  24. package/esm2020/msal.broadcast.service.mjs +0 -66
  25. package/esm2020/msal.guard.config.mjs +0 -6
  26. package/esm2020/msal.guard.mjs +0 -218
  27. package/esm2020/msal.interceptor.config.mjs +0 -6
  28. package/esm2020/msal.interceptor.mjs +0 -270
  29. package/esm2020/msal.module.mjs +0 -46
  30. package/esm2020/msal.navigation.client.mjs +0 -53
  31. package/esm2020/msal.redirect.component.mjs +0 -31
  32. package/esm2020/msal.service.mjs +0 -88
  33. package/esm2020/packageMetadata.mjs +0 -4
  34. package/esm2020/public-api.mjs +0 -18
  35. package/fesm2015/azure-msal-angular.mjs +0 -762
  36. package/fesm2015/azure-msal-angular.mjs.map +0 -1
  37. package/fesm2020/azure-msal-angular.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"azure-msal-angular.mjs","sources":["../../src/packageMetadata.ts","../../src/constants.ts","../../src/msal.broadcast.service.ts","../../src/msal.service.ts","../../src/msal.guard.ts","../../src/msal.interceptor.ts","../../src/msal.redirect.component.ts","../../src/msal.module.ts","../../src/msal.navigation.client.ts","../../src/public-api.ts","../../src/azure-msal-angular.ts"],"sourcesContent":["/* eslint-disable header/header */\nexport const name = \"@azure/msal-angular\";\nexport const version = \"5.0.0-beta.0\";\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { InjectionToken } from \"@angular/core\";\n\nimport { type IPublicClientApplication } from \"@azure/msal-browser\";\nimport { type MsalBroadcastConfiguration } from \"./msal.broadcast.config\";\nimport { type MsalGuardConfiguration } from \"./msal.guard.config\";\nimport { type MsalInterceptorConfiguration } from \"./msal.interceptor.config\";\n\nexport const MSAL_INSTANCE = new InjectionToken<IPublicClientApplication>(\n \"MSAL_INSTANCE\"\n);\n\nexport const MSAL_GUARD_CONFIG = new InjectionToken<MsalGuardConfiguration>(\n \"MSAL_GUARD_CONFIG\"\n);\n\nexport const MSAL_INTERCEPTOR_CONFIG =\n new InjectionToken<MsalInterceptorConfiguration>(\"MSAL_INTERCEPTOR_CONFIG\");\n\nexport const MSAL_BROADCAST_CONFIG =\n new InjectionToken<MsalBroadcastConfiguration>(\"MSAL_BROADCAST_CONFIG\");\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Inject, Injectable, Optional } from \"@angular/core\";\nimport {\n EventMessage,\n EventMessageUtils,\n IPublicClientApplication,\n InteractionStatus,\n} from \"@azure/msal-browser\";\nimport { BehaviorSubject, Observable, ReplaySubject, Subject } from \"rxjs\";\nimport { MsalBroadcastConfiguration } from \"./msal.broadcast.config\";\nimport { MSAL_BROADCAST_CONFIG, MSAL_INSTANCE } from \"./constants\";\nimport { name, version } from \"./packageMetadata\";\n\n@Injectable()\nexport class MsalBroadcastService {\n private _msalSubject: Subject<EventMessage>;\n public msalSubject$: Observable<EventMessage>;\n private _inProgress: BehaviorSubject<InteractionStatus>;\n public inProgress$: Observable<InteractionStatus>;\n\n constructor(\n @Inject(MSAL_INSTANCE) private msalInstance: IPublicClientApplication,\n @Optional()\n @Inject(MSAL_BROADCAST_CONFIG)\n private msalBroadcastConfig?: MsalBroadcastConfiguration\n ) {\n // Make _msalSubject a ReplaySubject if configured to replay past events\n if (\n this.msalBroadcastConfig &&\n this.msalBroadcastConfig.eventsToReplay > 0\n ) {\n this.msalInstance\n .getLogger()\n .clone(name, version)\n .verbose(\n `BroadcastService - eventsToReplay set on BroadcastConfig, replaying the last ${this.msalBroadcastConfig.eventsToReplay} events`,\n \"\"\n );\n this._msalSubject = new ReplaySubject<EventMessage>(\n this.msalBroadcastConfig.eventsToReplay\n );\n } else {\n // Defaults to _msalSubject being a Subject\n this._msalSubject = new Subject<EventMessage>();\n }\n\n this.msalSubject$ = this._msalSubject.asObservable();\n\n // InProgress as BehaviorSubject so most recent inProgress state will be available upon subscription\n this._inProgress = new BehaviorSubject<InteractionStatus>(\n InteractionStatus.Startup\n );\n this.inProgress$ = this._inProgress.asObservable();\n\n this.msalInstance.addEventCallback((message: EventMessage) => {\n this._msalSubject.next(message);\n const status = EventMessageUtils.getInteractionStatusFromEvent(\n message,\n this._inProgress.value\n );\n if (status !== null) {\n this.msalInstance\n .getLogger()\n .clone(name, version)\n .verbose(\n `BroadcastService - ${message.eventType} results in setting inProgress from ${this._inProgress.value} to ${status}`,\n \"\"\n );\n this._inProgress.next(status);\n }\n });\n }\n\n /**\n * Resets inProgress state to None\n */\n resetInProgressEvent(): void {\n if (this._inProgress.value === InteractionStatus.Startup) {\n this._inProgress.next(InteractionStatus.None);\n }\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Inject, Injectable, Injector } from \"@angular/core\";\nimport { Location } from \"@angular/common\";\nimport {\n IPublicClientApplication,\n EndSessionRequest,\n EndSessionPopupRequest,\n AuthenticationResult,\n RedirectRequest,\n SilentRequest,\n PopupRequest,\n SsoSilentRequest,\n Logger,\n WrapperSKU,\n} from \"@azure/msal-browser\";\nimport { Observable, from } from \"rxjs\";\nimport { IMsalService } from \"./IMsalService\";\nimport { name, version } from \"./packageMetadata\";\nimport { MSAL_INSTANCE } from \"./constants\";\nimport { MsalBroadcastService } from \"./msal.broadcast.service\";\n\n@Injectable()\nexport class MsalService implements IMsalService {\n private redirectHash: string;\n private logger: Logger;\n\n constructor(\n @Inject(MSAL_INSTANCE) public instance: IPublicClientApplication,\n private location: Location,\n private injector: Injector\n ) {\n const hash = this.location.path(true).split(\"#\").pop();\n if (hash) {\n this.redirectHash = `#${hash}`;\n }\n this.instance.initializeWrapperLibrary(WrapperSKU.Angular, version);\n }\n\n initialize(): Observable<void> {\n return from(this.instance.initialize());\n }\n acquireTokenPopup(request: PopupRequest): Observable<AuthenticationResult> {\n return from(this.instance.acquireTokenPopup(request));\n }\n acquireTokenRedirect(request: RedirectRequest): Observable<void> {\n return from(this.instance.acquireTokenRedirect(request));\n }\n acquireTokenSilent(\n silentRequest: SilentRequest\n ): Observable<AuthenticationResult> {\n return from(this.instance.acquireTokenSilent(silentRequest));\n }\n handleRedirectObservable(hash?: string): Observable<AuthenticationResult> {\n return from(\n this.instance\n .initialize()\n .then(() =>\n this.instance.handleRedirectPromise({\n hash: hash || this.redirectHash,\n })\n )\n .finally(() => {\n // update inProgress state to none\n this.injector.get(MsalBroadcastService).resetInProgressEvent();\n })\n );\n }\n loginPopup(request?: PopupRequest): Observable<AuthenticationResult> {\n return from(this.instance.loginPopup(request));\n }\n loginRedirect(request?: RedirectRequest): Observable<void> {\n return from(this.instance.loginRedirect(request));\n }\n logoutRedirect(logoutRequest?: EndSessionRequest): Observable<void> {\n return from(this.instance.logoutRedirect(logoutRequest));\n }\n logoutPopup(logoutRequest?: EndSessionPopupRequest): Observable<void> {\n return from(this.instance.logoutPopup(logoutRequest));\n }\n ssoSilent(request: SsoSilentRequest): Observable<AuthenticationResult> {\n return from(this.instance.ssoSilent(request));\n }\n /**\n * Gets logger for msal-angular.\n * If no logger set, returns logger instance created with same options as msal-browser\n */\n getLogger(): Logger {\n if (!this.logger) {\n this.logger = this.instance.getLogger().clone(name, version);\n }\n return this.logger;\n }\n // Create a logger instance for msal-angular with the same options as msal-browser\n setLogger(logger: Logger): void {\n this.logger = logger.clone(name, version);\n this.instance.setLogger(logger);\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Injectable, Inject } from \"@angular/core\";\nimport { Location } from \"@angular/common\";\nimport {\n ActivatedRouteSnapshot,\n RouterStateSnapshot,\n UrlTree,\n Router,\n} from \"@angular/router\";\nimport {\n InteractionType,\n BrowserConfigurationAuthError,\n BrowserUtils,\n PopupRequest,\n RedirectRequest,\n AuthenticationResult,\n} from \"@azure/msal-browser\";\nimport { Observable, of } from \"rxjs\";\nimport { concatMap, catchError, map } from \"rxjs/operators\";\nimport { MsalService } from \"./msal.service\";\nimport { MsalGuardConfiguration } from \"./msal.guard.config\";\nimport { MsalBroadcastService } from \"./msal.broadcast.service\";\nimport { MSAL_GUARD_CONFIG } from \"./constants\";\n\n@Injectable()\nexport class MsalGuard {\n private loginFailedRoute?: UrlTree;\n\n constructor(\n @Inject(MSAL_GUARD_CONFIG) private msalGuardConfig: MsalGuardConfiguration,\n private msalBroadcastService: MsalBroadcastService,\n private authService: MsalService,\n private location: Location,\n private router: Router\n ) {\n // Subscribing so events in MsalGuard will set inProgress$ observable\n this.msalBroadcastService.inProgress$.subscribe();\n }\n\n /**\n * Parses url string to UrlTree\n * @param url\n */\n parseUrl(url: string): UrlTree {\n return this.router.parseUrl(url);\n }\n\n /**\n * Builds the absolute url for the destination page\n * @param path Relative path of requested page\n * @returns Full destination url\n */\n getDestinationUrl(path: string): string {\n this.authService.getLogger().verbose(\"Guard - getting destination url\", \"\");\n // Absolute base url for the application (default to origin if base element not present)\n const baseElements = document.getElementsByTagName(\"base\");\n const baseUrl = this.location.normalize(\n baseElements.length ? baseElements[0].href : window.location.origin\n );\n\n // Path of page (including hash, if using hash routing)\n const pathUrl = this.location.prepareExternalUrl(path);\n\n // Hash location strategy\n if (pathUrl.startsWith(\"#\")) {\n this.authService\n .getLogger()\n .verbose(\"Guard - destination by hash routing\", \"\");\n return `${baseUrl}/${pathUrl}`;\n }\n\n /*\n * If using path location strategy, pathUrl will include the relative portion of the base path (e.g. /base/page).\n * Since baseUrl also includes /base, can just concatentate baseUrl + path\n */\n return `${baseUrl}${path}`;\n }\n\n /**\n * Interactively prompt the user to login\n * @param url Path of the requested page\n */\n private loginInteractively(state: RouterStateSnapshot): Observable<boolean> {\n const authRequest =\n typeof this.msalGuardConfig.authRequest === \"function\"\n ? this.msalGuardConfig.authRequest(this.authService, state)\n : { ...this.msalGuardConfig.authRequest };\n if (this.msalGuardConfig.interactionType === InteractionType.Popup) {\n this.authService\n .getLogger()\n .verbose(\"Guard - logging in by popup\", authRequest.correlationId);\n return this.authService.loginPopup(authRequest as PopupRequest).pipe(\n map((response: AuthenticationResult) => {\n this.authService\n .getLogger()\n .verbose(\n \"Guard - login by popup successful, can activate, setting active account\",\n authRequest.correlationId\n );\n this.authService.instance.setActiveAccount(response.account);\n return true;\n })\n );\n }\n\n this.authService\n .getLogger()\n .verbose(\"Guard - logging in by redirect\", authRequest.correlationId);\n const redirectStartPage = this.getDestinationUrl(state.url);\n return this.authService\n .loginRedirect({\n redirectStartPage,\n ...authRequest,\n } as RedirectRequest)\n .pipe(map(() => false));\n }\n\n /**\n * Helper which checks for the correct interaction type, prevents page with Guard to be set as redirect, and calls handleRedirectObservable\n * @param state\n */\n private activateHelper(\n state?: RouterStateSnapshot\n ): Observable<boolean | UrlTree> {\n if (\n this.msalGuardConfig.interactionType !== InteractionType.Popup &&\n this.msalGuardConfig.interactionType !== InteractionType.Redirect\n ) {\n throw new BrowserConfigurationAuthError(\n \"invalid_interaction_type\",\n \"Invalid interaction type provided to MSAL Guard. InteractionType.Popup or InteractionType.Redirect must be provided in the MsalGuardConfiguration\"\n );\n }\n this.authService.getLogger().verbose(\"MSAL Guard activated\", \"\");\n\n /*\n * If a page with MSAL Guard is set as the redirect for acquireTokenSilent,\n * short-circuit to prevent redirecting or popups.\n */\n if (typeof window === \"undefined\") {\n this.authService\n .getLogger()\n .info(\n \"Guard - window is undefined, MSAL does not support server-side token acquisition\",\n \"\"\n );\n return of(true);\n } else {\n try {\n BrowserUtils.blockReloadInHiddenIframes();\n } catch (error) {\n if (\n !this.authService.instance.getConfiguration().system\n .allowRedirectInIframe\n ) {\n this.authService\n .getLogger()\n .warning(\n \"Guard - redirectUri set to page with MSAL Guard. It is recommended to not set redirectUri to a page that requires authentication.\",\n \"\"\n );\n return of(false);\n }\n }\n }\n\n /**\n * If a loginFailedRoute is set in the config, set this as the loginFailedRoute\n */\n if (this.msalGuardConfig.loginFailedRoute) {\n this.loginFailedRoute = this.parseUrl(\n this.msalGuardConfig.loginFailedRoute\n );\n }\n\n // Capture current path before it gets changed by handleRedirectObservable\n const currentPath = this.location.path(true);\n\n return this.authService.initialize().pipe(\n concatMap(() => {\n return this.authService.handleRedirectObservable();\n }),\n concatMap(() => {\n if (!this.authService.instance.getAllAccounts().length) {\n if (state) {\n this.authService\n .getLogger()\n .verbose(\n \"Guard - no accounts retrieved, log in required to activate\",\n \"\"\n );\n return this.loginInteractively(state);\n }\n this.authService\n .getLogger()\n .verbose(\n \"Guard - no accounts retrieved, no state, cannot load\",\n \"\"\n );\n return of(false);\n }\n\n this.authService\n .getLogger()\n .verbose(\n \"Guard - at least 1 account exists, can activate or load\",\n \"\"\n );\n\n // Prevent navigating the app to /#code= or /code=\n if (state) {\n /*\n * Path routing:\n * state.url: /#code=...\n * state.root.fragment: code=...\n */\n\n /*\n * Hash routing:\n * state.url: /code\n * state.root.fragment: null\n */\n const urlContainsCode: boolean = this.includesCode(state.url);\n const fragmentContainsCode: boolean =\n !!state.root &&\n !!state.root.fragment &&\n this.includesCode(`#${state.root.fragment}`);\n const hashRouting: boolean =\n this.location.prepareExternalUrl(state.url).indexOf(\"#\") === 0;\n\n // Ensure code parameter is in fragment (and not in query parameter), or that hash hash routing is used\n if (urlContainsCode && (fragmentContainsCode || hashRouting)) {\n this.authService\n .getLogger()\n .info(\n \"Guard - Hash contains known code response, stopping navigation.\",\n \"\"\n );\n\n // Path routing (navigate to current path without hash)\n if (currentPath.indexOf(\"#\") > -1) {\n return of(this.parseUrl(this.location.path()));\n }\n\n // Hash routing (navigate to root path)\n return of(this.parseUrl(\"\"));\n }\n }\n\n return of(true);\n }),\n catchError((error: Error) => {\n this.authService\n .getLogger()\n .error(\"Guard - error while logging in, unable to activate\", \"\");\n this.authService\n .getLogger()\n .errorPii(`Guard - error: ${error.message}`, \"\");\n /**\n * If a loginFailedRoute is set, checks to see if state is passed before returning route\n */\n if (this.loginFailedRoute && state) {\n this.authService\n .getLogger()\n .verbose(\"Guard - loginFailedRoute set, redirecting\", \"\");\n return of(this.loginFailedRoute);\n }\n return of(false);\n })\n );\n }\n\n includesCode(path: string): boolean {\n return (\n (path.lastIndexOf(\"/code\") > -1 &&\n path.lastIndexOf(\"/code\") === path.length - \"/code\".length) || // path.endsWith(\"/code\")\n path.indexOf(\"#code=\") > -1 ||\n path.indexOf(\"&code=\") > -1\n );\n }\n\n canActivate(\n route: ActivatedRouteSnapshot,\n state: RouterStateSnapshot\n ): Observable<boolean | UrlTree> {\n this.authService.getLogger().verbose(\"Guard - canActivate\", \"\");\n return this.activateHelper(state);\n }\n\n canActivateChild(\n route: ActivatedRouteSnapshot,\n state: RouterStateSnapshot\n ): Observable<boolean | UrlTree> {\n this.authService.getLogger().verbose(\"Guard - canActivateChild\", \"\");\n return this.activateHelper(state);\n }\n\n canMatch(): Observable<boolean | UrlTree> {\n this.authService.getLogger().verbose(\"Guard - canLoad\", \"\");\n return this.activateHelper();\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Injectable, Inject } from \"@angular/core\";\nimport { Location, DOCUMENT } from \"@angular/common\";\nimport {\n HttpRequest,\n HttpHandler,\n HttpEvent,\n HttpInterceptor,\n} from \"@angular/common/http\"; // eslint-disable-line import/no-unresolved\nimport {\n AccountInfo,\n AuthenticationResult,\n BrowserConfigurationAuthError,\n InteractionStatus,\n InteractionType,\n} from \"@azure/msal-browser\";\nimport { Observable, EMPTY, of } from \"rxjs\";\nimport { switchMap, catchError, take, filter } from \"rxjs/operators\";\nimport { MsalService } from \"./msal.service\";\nimport {\n MsalInterceptorAuthRequest,\n MsalInterceptorConfiguration,\n ProtectedResourceScopes,\n} from \"./msal.interceptor.config\";\nimport { MsalBroadcastService } from \"./msal.broadcast.service\";\nimport { MSAL_INTERCEPTOR_CONFIG } from \"./constants\";\n\n@Injectable()\nexport class MsalInterceptor implements HttpInterceptor {\n private _document?: Document;\n\n constructor(\n @Inject(MSAL_INTERCEPTOR_CONFIG)\n private msalInterceptorConfig: MsalInterceptorConfiguration,\n private authService: MsalService,\n private location: Location,\n private msalBroadcastService: MsalBroadcastService,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\n @Inject(DOCUMENT) document?: any\n ) {\n this._document = document as Document;\n }\n\n intercept(\n req: HttpRequest<any>, // eslint-disable-line @typescript-eslint/no-explicit-any\n next: HttpHandler\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ): Observable<HttpEvent<any>> {\n if (\n this.msalInterceptorConfig.interactionType !== InteractionType.Popup &&\n this.msalInterceptorConfig.interactionType !== InteractionType.Redirect\n ) {\n throw new BrowserConfigurationAuthError(\n \"invalid_interaction_type\",\n \"Invalid interaction type provided to MSAL Interceptor. InteractionType.Popup, InteractionType.Redirect must be provided in the msalInterceptorConfiguration\"\n );\n }\n\n this.authService.getLogger().verbose(\"MSAL Interceptor activated\", \"\");\n const scopes = this.getScopesForEndpoint(req.url, req.method);\n\n // If no scopes for endpoint, does not acquire token\n if (!scopes || scopes.length === 0) {\n this.authService\n .getLogger()\n .verbose(\"Interceptor - no scopes for endpoint\", \"\");\n return next.handle(req);\n }\n\n // Sets account as active account or first account\n let account: AccountInfo;\n if (!!this.authService.instance.getActiveAccount()) {\n this.authService\n .getLogger()\n .verbose(\"Interceptor - active account selected\", \"\");\n account = this.authService.instance.getActiveAccount();\n } else {\n this.authService\n .getLogger()\n .verbose(\n \"Interceptor - no active account, fallback to first account\",\n \"\"\n );\n account = this.authService.instance.getAllAccounts()[0];\n }\n\n const authRequest =\n typeof this.msalInterceptorConfig.authRequest === \"function\"\n ? this.msalInterceptorConfig.authRequest(this.authService, req, {\n account: account,\n })\n : { ...this.msalInterceptorConfig.authRequest, account };\n\n this.authService\n .getLogger()\n .info(`Interceptor - ${scopes.length} scopes found for endpoint`, \"\");\n this.authService\n .getLogger()\n .infoPii(`Interceptor - [${scopes}] scopes found for ${req.url}`, \"\");\n\n return this.acquireToken(authRequest, scopes, account).pipe(\n switchMap((result: AuthenticationResult) => {\n this.authService\n .getLogger()\n .verbose(\"Interceptor - setting authorization headers\", \"\");\n const headers = req.headers.set(\n \"Authorization\",\n `Bearer ${result.accessToken}`\n );\n\n const requestClone = req.clone({ headers });\n return next.handle(requestClone);\n })\n );\n }\n\n /**\n * Try to acquire token silently. Invoke interaction if acquireTokenSilent rejected with error or resolved with null access token\n * @param authRequest Request\n * @param scopes Array of scopes for the request\n * @param account Account\n * @returns Authentication result\n */\n private acquireToken(\n authRequest: MsalInterceptorAuthRequest,\n scopes: string[],\n account: AccountInfo\n ): Observable<AuthenticationResult> {\n // Note: For MSA accounts, include openid scope when calling acquireTokenSilent to return idToken\n return this.authService\n .acquireTokenSilent({ ...authRequest, scopes, account })\n .pipe(\n catchError(() => {\n this.authService\n .getLogger()\n .error(\n \"Interceptor - acquireTokenSilent rejected with error. Invoking interaction to resolve.\",\n authRequest.correlationId\n );\n return this.msalBroadcastService.inProgress$.pipe(\n take(1),\n switchMap((status: InteractionStatus) => {\n if (status === InteractionStatus.None) {\n return this.acquireTokenInteractively(authRequest, scopes);\n }\n\n return this.msalBroadcastService.inProgress$.pipe(\n filter(\n (status: InteractionStatus) =>\n status === InteractionStatus.None\n ),\n take(1),\n switchMap(() => this.acquireToken(authRequest, scopes, account))\n );\n })\n );\n }),\n switchMap((result: AuthenticationResult) => {\n if (!result.accessToken) {\n this.authService\n .getLogger()\n .error(\n \"Interceptor - acquireTokenSilent resolved with null access token. Known issue with B2C tenants, invoking interaction to resolve.\",\n authRequest.correlationId\n );\n return this.msalBroadcastService.inProgress$.pipe(\n filter(\n (status: InteractionStatus) => status === InteractionStatus.None\n ),\n take(1),\n switchMap(() =>\n this.acquireTokenInteractively(authRequest, scopes)\n )\n );\n }\n return of(result);\n })\n );\n }\n\n /**\n * Invoke interaction for the given set of scopes\n * @param authRequest Request\n * @param scopes Array of scopes for the request\n * @returns Result from the interactive request\n */\n private acquireTokenInteractively(\n authRequest: MsalInterceptorAuthRequest,\n scopes: string[]\n ): Observable<AuthenticationResult> {\n if (this.msalInterceptorConfig.interactionType === InteractionType.Popup) {\n this.authService\n .getLogger()\n .verbose(\n \"Interceptor - error acquiring token silently, acquiring by popup\",\n authRequest.correlationId\n );\n return this.authService.acquireTokenPopup({ ...authRequest, scopes });\n }\n this.authService\n .getLogger()\n .verbose(\n \"Interceptor - error acquiring token silently, acquiring by redirect\",\n authRequest.correlationId\n );\n const redirectStartPage = window.location.href;\n this.authService.acquireTokenRedirect({\n ...authRequest,\n scopes,\n redirectStartPage,\n });\n return EMPTY;\n }\n\n /**\n * Looks up the scopes for the given endpoint from the protectedResourceMap\n * @param endpoint Url of the request\n * @param httpMethod Http method of the request\n * @returns Array of scopes, or null if not found\n *\n */\n private getScopesForEndpoint(\n endpoint: string,\n httpMethod: string\n ): Array<string> | null {\n this.authService\n .getLogger()\n .verbose(\"Interceptor - getting scopes for endpoint\", \"\");\n\n // Ensures endpoints and protected resources compared are normalized\n const normalizedEndpoint = this.location.normalize(endpoint);\n\n const protectedResourcesArray = Array.from(\n this.msalInterceptorConfig.protectedResourceMap.keys()\n );\n\n const matchingProtectedResources = this.matchResourcesToEndpoint(\n protectedResourcesArray,\n normalizedEndpoint\n );\n\n if (matchingProtectedResources.length > 0) {\n return this.matchScopesToEndpoint(\n this.msalInterceptorConfig.protectedResourceMap,\n matchingProtectedResources,\n httpMethod\n );\n }\n\n return null;\n }\n\n /**\n * Finds resource endpoints that match request endpoint\n * @param protectedResourcesEndpoints\n * @param endpoint\n * @returns\n */\n private matchResourcesToEndpoint(\n protectedResourcesEndpoints: string[],\n endpoint: string\n ): Array<string> {\n const matchingResources: Array<string> = [];\n\n protectedResourcesEndpoints.forEach((key) => {\n const normalizedKey = this.location.normalize(key);\n\n // Get url components\n const absoluteKey = this.getAbsoluteUrl(normalizedKey);\n const keyComponents = new URL(absoluteKey);\n const absoluteEndpoint = this.getAbsoluteUrl(endpoint);\n const endpointComponents = new URL(absoluteEndpoint);\n\n if (this.checkUrlComponents(keyComponents, endpointComponents)) {\n matchingResources.push(key);\n }\n });\n\n return matchingResources;\n }\n\n /**\n * Compares URL segments between key and endpoint\n * @param key\n * @param endpoint\n * @returns\n */\n private checkUrlComponents(\n keyComponents: URL,\n endpointComponents: URL\n ): boolean {\n // URL properties from https://developer.mozilla.org/en-US/docs/Web/API/URL\n const urlProperties = [\"protocol\", \"host\", \"pathname\", \"search\", \"hash\"];\n\n for (const property of urlProperties) {\n if (keyComponents[property]) {\n const decodedInput = decodeURIComponent(keyComponents[property]);\n if (!this.matchPattern(decodedInput, endpointComponents[property])) {\n return false;\n }\n }\n }\n\n return true;\n }\n\n /**\n * Transforms relative urls to absolute urls\n * @param url\n * @returns\n */\n private getAbsoluteUrl(url: string): string {\n const link = this._document.createElement(\"a\");\n link.href = url;\n return link.href;\n }\n\n /**\n * Finds scopes from first matching endpoint with HTTP method that matches request\n * @param protectedResourceMap Protected resource map\n * @param endpointArray Array of resources that match request endpoint\n * @param httpMethod Http method of the request\n * @returns\n */\n private matchScopesToEndpoint(\n protectedResourceMap: Map<\n string,\n Array<string | ProtectedResourceScopes> | null\n >,\n endpointArray: string[],\n httpMethod: string\n ): Array<string> | null {\n const allMatchedScopes = [];\n\n // Check each matched endpoint for matching HttpMethod and scopes\n endpointArray.forEach((matchedEndpoint) => {\n const scopesForEndpoint = [];\n const methodAndScopesArray = protectedResourceMap.get(matchedEndpoint);\n\n // Return if resource is unprotected\n if (methodAndScopesArray === null) {\n allMatchedScopes.push(null);\n return;\n }\n\n methodAndScopesArray.forEach((entry) => {\n // Entry is either array of scopes or ProtectedResourceScopes object\n if (typeof entry === \"string\") {\n scopesForEndpoint.push(entry);\n } else {\n // Ensure methods being compared are normalized\n const normalizedRequestMethod = httpMethod.toLowerCase();\n const normalizedResourceMethod = entry.httpMethod.toLowerCase();\n // Method in protectedResourceMap matches request http method\n if (normalizedResourceMethod === normalizedRequestMethod) {\n // Validate if scopes comes null to unprotect the resource in a certain http method\n if (entry.scopes === null) {\n allMatchedScopes.push(null);\n } else {\n entry.scopes.forEach((scope) => {\n scopesForEndpoint.push(scope);\n });\n }\n }\n }\n });\n\n // Only add to all scopes if scopes for endpoint and method is found\n if (scopesForEndpoint.length > 0) {\n allMatchedScopes.push(scopesForEndpoint);\n }\n });\n\n if (allMatchedScopes.length > 0) {\n if (allMatchedScopes.length > 1) {\n this.authService\n .getLogger()\n .warning(\n \"Interceptor - More than 1 matching scopes for endpoint found.\",\n \"\"\n );\n }\n // Returns scopes for first matching endpoint\n return allMatchedScopes[0];\n }\n\n return null;\n }\n\n /**\n * Tests if a given string matches a given pattern, with support for wildcards and queries.\n * @param pattern Wildcard pattern to string match. Supports \"*\" for wildcards and \"?\" for queries\n * @param input String to match against\n */\n private matchPattern(pattern: string, input: string): boolean {\n /**\n * Wildcard support: https://stackoverflow.com/a/3117248/4888559\n * Queries: replaces \"?\" in string with escaped \"\\?\" for regex test\n */\n // eslint-disable-next-line security/detect-non-literal-regexp\n const regex: RegExp = new RegExp(\n pattern\n .replace(/\\\\/g, \"\\\\\\\\\")\n .replace(/\\*/g, \"[^ ]*\")\n .replace(/\\?/g, \"\\\\?\")\n );\n\n return regex.test(input);\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * This is a dedicated redirect component to be added to Angular apps to\n * handle redirects when using @azure/msal-angular.\n * Import this component to use redirects in your app.\n */\n\nimport { Component, OnInit } from \"@angular/core\";\nimport { MsalService } from \"./msal.service\";\n\n@Component({\n selector: \"app-redirect\",\n template: \"\",\n standalone: false,\n})\nexport class MsalRedirectComponent implements OnInit {\n constructor(private authService: MsalService) {}\n\n ngOnInit(): void {\n this.authService.getLogger().verbose(\"MsalRedirectComponent activated\", \"\");\n this.authService.handleRedirectObservable().subscribe();\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ModuleWithProviders, NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { IPublicClientApplication } from \"@azure/msal-browser\";\nimport { MsalBroadcastService } from \"./msal.broadcast.service\";\nimport { MsalGuard } from \"./msal.guard\";\nimport { MsalGuardConfiguration } from \"./msal.guard.config\";\nimport { MsalInterceptorConfiguration } from \"./msal.interceptor.config\";\nimport { MsalRedirectComponent } from \"./msal.redirect.component\";\nimport { MsalService } from \"./msal.service\";\nimport {\n MSAL_INSTANCE,\n MSAL_GUARD_CONFIG,\n MSAL_INTERCEPTOR_CONFIG,\n} from \"./constants\";\n\n@NgModule({\n declarations: [MsalRedirectComponent],\n imports: [CommonModule],\n providers: [MsalGuard, MsalBroadcastService],\n})\nexport class MsalModule {\n static forRoot(\n msalInstance: IPublicClientApplication,\n guardConfig: MsalGuardConfiguration,\n interceptorConfig: MsalInterceptorConfiguration\n ): ModuleWithProviders<MsalModule> {\n return {\n ngModule: MsalModule,\n providers: [\n {\n provide: MSAL_INSTANCE,\n useValue: msalInstance,\n },\n {\n provide: MSAL_GUARD_CONFIG,\n useValue: guardConfig,\n },\n {\n provide: MSAL_INTERCEPTOR_CONFIG,\n useValue: interceptorConfig,\n },\n MsalService,\n ],\n };\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Injectable } from \"@angular/core\";\nimport { Location } from \"@angular/common\";\nimport { Router } from \"@angular/router\";\nimport { NavigationClient, NavigationOptions } from \"@azure/msal-browser\";\nimport { MsalService } from \"./msal.service\";\n\n/**\n * Custom navigation used for Angular client-side navigation.\n * See performance doc for details:\n * https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-angular/docs/performance.md\n */\n@Injectable()\nexport class MsalCustomNavigationClient extends NavigationClient {\n constructor(\n private authService: MsalService,\n private router: Router,\n private location: Location\n ) {\n super();\n }\n\n async navigateInternal(\n url: string,\n options: NavigationOptions\n ): Promise<boolean> {\n this.authService.getLogger().trace(\"MsalCustomNavigationClient called\", \"\");\n\n this.authService\n .getLogger()\n .verbose(\"MsalCustomNavigationClient - navigating\", \"\");\n this.authService\n .getLogger()\n .verbosePii(`MsalCustomNavigationClient - navigating to url: ${url}`, \"\");\n\n // Prevent hash clearing from causing an issue with Client-side navigation after redirect is handled\n if (options.noHistory) {\n return super.navigateInternal(url, options);\n } else {\n // Normalizing newUrl if no query string\n const urlComponents = new URL(url);\n const newUrl = urlComponents.search\n ? `${urlComponents.pathname}${urlComponents.search}`\n : this.location.normalize(urlComponents.pathname);\n await this.router.navigateByUrl(newUrl, {\n replaceUrl: options.noHistory,\n });\n }\n return Promise.resolve(options.noHistory);\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @packageDocumentation\n * @module @azure/msal-angular\n */\n\nexport { MsalService } from \"./msal.service\";\nexport { IMsalService } from \"./IMsalService\";\nexport { MsalGuard } from \"./msal.guard\";\nexport {\n MsalGuardConfiguration,\n MsalGuardAuthRequest,\n} from \"./msal.guard.config\";\nexport { MsalInterceptor } from \"./msal.interceptor\";\nexport {\n MsalInterceptorConfiguration,\n MsalInterceptorAuthRequest,\n ProtectedResourceScopes,\n} from \"./msal.interceptor.config\";\nexport {\n MSAL_INSTANCE,\n MSAL_GUARD_CONFIG,\n MSAL_INTERCEPTOR_CONFIG,\n MSAL_BROADCAST_CONFIG,\n} from \"./constants\";\nexport { MsalBroadcastService } from \"./msal.broadcast.service\";\nexport { MsalBroadcastConfiguration } from \"./msal.broadcast.config\";\nexport { MsalModule } from \"./msal.module\";\nexport { MsalRedirectComponent } from \"./msal.redirect.component\";\nexport { MsalCustomNavigationClient } from \"./msal.navigation.client\";\nexport { version } from \"./packageMetadata\";\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1","i1.MsalBroadcastService","i2.MsalService","i1.MsalService","i2","i3.MsalBroadcastService"],"mappings":";;;;;;;;;AAAA;AACO,MAAM,IAAI,GAAG,qBAAqB;AAClC,MAAM,OAAO,GAAG;;ACFvB;;;AAGG;MASU,aAAa,GAAG,IAAI,cAAc,CAC7C,eAAe;MAGJ,iBAAiB,GAAG,IAAI,cAAc,CACjD,mBAAmB;MAGR,uBAAuB,GAClC,IAAI,cAAc,CAA+B,yBAAyB;MAE/D,qBAAqB,GAChC,IAAI,cAAc,CAA6B,uBAAuB;;ACxBxE;;;AAGG;MAeU,oBAAoB,CAAA;IAM/B,WACiC,CAAA,YAAsC,EAG7D,mBAAgD,EAAA;QAHzB,IAAY,CAAA,YAAA,GAAZ,YAAY;QAGnC,IAAmB,CAAA,mBAAA,GAAnB,mBAAmB;;QAG3B,IACE,IAAI,CAAC,mBAAmB;AACxB,YAAA,IAAI,CAAC,mBAAmB,CAAC,cAAc,GAAG,CAAC,EAC3C;AACA,YAAA,IAAI,CAAC;AACF,iBAAA,SAAS;AACT,iBAAA,KAAK,CAAC,IAAI,EAAE,OAAO;iBACnB,OAAO,CAC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A,CAAA,QAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;mHAA1B,0BAA0B,EAAA,CAAA,CAAA;;4FAA1B,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBADtC;;;AChBD;;;AAGG;AAEH;;;AAGG;;ACRH;;AAEG;;;;"}
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- /// <amd-module name="@azure/msal-angular" />
5
- export * from './public-api';
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="@azure/msal-angular" />
5
+ export * from './public-api';
@@ -1,3 +1,3 @@
1
- export type MsalBroadcastConfiguration = {
2
- eventsToReplay: number;
3
- };
1
+ export type MsalBroadcastConfiguration = {
2
+ eventsToReplay: number;
3
+ };
@@ -1,19 +1,19 @@
1
- import { EventMessage, IPublicClientApplication, InteractionStatus } from "@azure/msal-browser";
2
- import { Observable } from "rxjs";
3
- import { MsalBroadcastConfiguration } from "./msal.broadcast.config";
4
- import * as i0 from "@angular/core";
5
- export declare class MsalBroadcastService {
6
- private msalInstance;
7
- private msalBroadcastConfig?;
8
- private _msalSubject;
9
- msalSubject$: Observable<EventMessage>;
10
- private _inProgress;
11
- inProgress$: Observable<InteractionStatus>;
12
- constructor(msalInstance: IPublicClientApplication, msalBroadcastConfig?: MsalBroadcastConfiguration);
13
- /**
14
- * Resets inProgress state to None
15
- */
16
- resetInProgressEvent(): void;
17
- static ɵfac: i0.ɵɵFactoryDeclaration<MsalBroadcastService, [null, { optional: true; }]>;
18
- static ɵprov: i0.ɵɵInjectableDeclaration<MsalBroadcastService>;
19
- }
1
+ import { EventMessage, IPublicClientApplication, InteractionStatus } from "@azure/msal-browser";
2
+ import { Observable } from "rxjs";
3
+ import { MsalBroadcastConfiguration } from "./msal.broadcast.config";
4
+ import * as i0 from "@angular/core";
5
+ export declare class MsalBroadcastService {
6
+ private msalInstance;
7
+ private msalBroadcastConfig?;
8
+ private _msalSubject;
9
+ msalSubject$: Observable<EventMessage>;
10
+ private _inProgress;
11
+ inProgress$: Observable<InteractionStatus>;
12
+ constructor(msalInstance: IPublicClientApplication, msalBroadcastConfig?: MsalBroadcastConfiguration);
13
+ /**
14
+ * Resets inProgress state to None
15
+ */
16
+ resetInProgressEvent(): void;
17
+ static ɵfac: i0.ɵɵFactoryDeclaration<MsalBroadcastService, [null, { optional: true; }]>;
18
+ static ɵprov: i0.ɵɵInjectableDeclaration<MsalBroadcastService>;
19
+ }
@@ -1,9 +1,9 @@
1
- import { RouterStateSnapshot } from "@angular/router";
2
- import { PopupRequest, RedirectRequest, InteractionType } from "@azure/msal-browser";
3
- import { MsalService } from "./msal.service";
4
- export declare type MsalGuardAuthRequest = Partial<PopupRequest> | Partial<Omit<RedirectRequest, "redirectStartPage">>;
5
- export type MsalGuardConfiguration = {
6
- interactionType: InteractionType.Popup | InteractionType.Redirect;
7
- authRequest?: MsalGuardAuthRequest | ((authService: MsalService, state: RouterStateSnapshot) => MsalGuardAuthRequest);
8
- loginFailedRoute?: string;
9
- };
1
+ import { RouterStateSnapshot } from "@angular/router";
2
+ import { PopupRequest, RedirectRequest, InteractionType } from "@azure/msal-browser";
3
+ import { MsalService } from "./msal.service";
4
+ export declare type MsalGuardAuthRequest = Partial<PopupRequest> | Partial<Omit<RedirectRequest, "redirectStartPage">>;
5
+ export type MsalGuardConfiguration = {
6
+ interactionType: InteractionType.Popup | InteractionType.Redirect;
7
+ authRequest?: MsalGuardAuthRequest | ((authService: MsalService, state: RouterStateSnapshot) => MsalGuardAuthRequest);
8
+ loginFailedRoute?: string;
9
+ };
package/msal.guard.d.ts CHANGED
@@ -1,43 +1,43 @@
1
- import { Location } from "@angular/common";
2
- import { ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree, Router } from "@angular/router";
3
- import { Observable } from "rxjs";
4
- import { MsalService } from "./msal.service";
5
- import { MsalGuardConfiguration } from "./msal.guard.config";
6
- import { MsalBroadcastService } from "./msal.broadcast.service";
7
- import * as i0 from "@angular/core";
8
- export declare class MsalGuard {
9
- private msalGuardConfig;
10
- private msalBroadcastService;
11
- private authService;
12
- private location;
13
- private router;
14
- private loginFailedRoute?;
15
- constructor(msalGuardConfig: MsalGuardConfiguration, msalBroadcastService: MsalBroadcastService, authService: MsalService, location: Location, router: Router);
16
- /**
17
- * Parses url string to UrlTree
18
- * @param url
19
- */
20
- parseUrl(url: string): UrlTree;
21
- /**
22
- * Builds the absolute url for the destination page
23
- * @param path Relative path of requested page
24
- * @returns Full destination url
25
- */
26
- getDestinationUrl(path: string): string;
27
- /**
28
- * Interactively prompt the user to login
29
- * @param url Path of the requested page
30
- */
31
- private loginInteractively;
32
- /**
33
- * Helper which checks for the correct interaction type, prevents page with Guard to be set as redirect, and calls handleRedirectObservable
34
- * @param state
35
- */
36
- private activateHelper;
37
- includesCode(path: string): boolean;
38
- canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean | UrlTree>;
39
- canActivateChild(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean | UrlTree>;
40
- canMatch(): Observable<boolean | UrlTree>;
41
- static ɵfac: i0.ɵɵFactoryDeclaration<MsalGuard, never>;
42
- static ɵprov: i0.ɵɵInjectableDeclaration<MsalGuard>;
43
- }
1
+ import { Location } from "@angular/common";
2
+ import { ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree, Router } from "@angular/router";
3
+ import { Observable } from "rxjs";
4
+ import { MsalService } from "./msal.service";
5
+ import { MsalGuardConfiguration } from "./msal.guard.config";
6
+ import { MsalBroadcastService } from "./msal.broadcast.service";
7
+ import * as i0 from "@angular/core";
8
+ export declare class MsalGuard {
9
+ private msalGuardConfig;
10
+ private msalBroadcastService;
11
+ private authService;
12
+ private location;
13
+ private router;
14
+ private loginFailedRoute?;
15
+ constructor(msalGuardConfig: MsalGuardConfiguration, msalBroadcastService: MsalBroadcastService, authService: MsalService, location: Location, router: Router);
16
+ /**
17
+ * Parses url string to UrlTree
18
+ * @param url
19
+ */
20
+ parseUrl(url: string): UrlTree;
21
+ /**
22
+ * Builds the absolute url for the destination page
23
+ * @param path Relative path of requested page
24
+ * @returns Full destination url
25
+ */
26
+ getDestinationUrl(path: string): string;
27
+ /**
28
+ * Interactively prompt the user to login
29
+ * @param url Path of the requested page
30
+ */
31
+ private loginInteractively;
32
+ /**
33
+ * Helper which checks for the correct interaction type, prevents page with Guard to be set as redirect, and calls handleRedirectObservable
34
+ * @param state
35
+ */
36
+ private activateHelper;
37
+ includesCode(path: string): boolean;
38
+ canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean | UrlTree>;
39
+ canActivateChild(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean | UrlTree>;
40
+ canMatch(): Observable<boolean | UrlTree>;
41
+ static ɵfac: i0.ɵɵFactoryDeclaration<MsalGuard, never>;
42
+ static ɵprov: i0.ɵɵInjectableDeclaration<MsalGuard>;
43
+ }
@@ -1,13 +1,13 @@
1
- import { HttpRequest } from "@angular/common/http";
2
- import { PopupRequest, RedirectRequest, InteractionType, SilentRequest } from "@azure/msal-browser";
3
- import { MsalService } from "./msal.service";
4
- export declare type MsalInterceptorAuthRequest = Omit<PopupRequest, "scopes"> | Omit<RedirectRequest, "scopes"> | Omit<SilentRequest, "scopes">;
5
- export type MsalInterceptorConfiguration = {
6
- interactionType: InteractionType.Popup | InteractionType.Redirect;
7
- protectedResourceMap: Map<string, Array<string | ProtectedResourceScopes> | null>;
8
- authRequest?: MsalInterceptorAuthRequest | ((msalService: MsalService, req: HttpRequest<unknown>, originalAuthRequest: MsalInterceptorAuthRequest) => MsalInterceptorAuthRequest);
9
- };
10
- export type ProtectedResourceScopes = {
11
- httpMethod: string;
12
- scopes: Array<string> | null;
13
- };
1
+ import { HttpRequest } from "@angular/common/http";
2
+ import { PopupRequest, RedirectRequest, InteractionType, SilentRequest } from "@azure/msal-browser";
3
+ import { MsalService } from "./msal.service";
4
+ export declare type MsalInterceptorAuthRequest = Omit<PopupRequest, "scopes"> | Omit<RedirectRequest, "scopes"> | Omit<SilentRequest, "scopes">;
5
+ export type MsalInterceptorConfiguration = {
6
+ interactionType: InteractionType.Popup | InteractionType.Redirect;
7
+ protectedResourceMap: Map<string, Array<string | ProtectedResourceScopes> | null>;
8
+ authRequest?: MsalInterceptorAuthRequest | ((msalService: MsalService, req: HttpRequest<unknown>, originalAuthRequest: MsalInterceptorAuthRequest) => MsalInterceptorAuthRequest);
9
+ };
10
+ export type ProtectedResourceScopes = {
11
+ httpMethod: string;
12
+ scopes: Array<string> | null;
13
+ };
@@ -1,70 +1,76 @@
1
- import { Location } from "@angular/common";
2
- import { HttpRequest, HttpHandler, HttpEvent, HttpInterceptor } from "@angular/common/http";
3
- import { Observable } from "rxjs";
4
- import { MsalService } from "./msal.service";
5
- import { MsalInterceptorConfiguration } from "./msal.interceptor.config";
6
- import { MsalBroadcastService } from "./msal.broadcast.service";
7
- import * as i0 from "@angular/core";
8
- export declare class MsalInterceptor implements HttpInterceptor {
9
- private msalInterceptorConfig;
10
- private authService;
11
- private location;
12
- private msalBroadcastService;
13
- private _document?;
14
- constructor(msalInterceptorConfig: MsalInterceptorConfiguration, authService: MsalService, location: Location, msalBroadcastService: MsalBroadcastService, document?: any);
15
- intercept(req: HttpRequest<any>, // eslint-disable-line @typescript-eslint/no-explicit-any
16
- next: HttpHandler): Observable<HttpEvent<any>>;
17
- /**
18
- * Try to acquire token silently. Invoke interaction if acquireTokenSilent rejected with error or resolved with null access token
19
- * @param authRequest Request
20
- * @param scopes Array of scopes for the request
21
- * @param account Account
22
- * @returns Authentication result
23
- */
24
- private acquireToken;
25
- /**
26
- * Invoke interaction for the given set of scopes
27
- * @param authRequest Request
28
- * @param scopes Array of scopes for the request
29
- * @returns Result from the interactive request
30
- */
31
- private acquireTokenInteractively;
32
- /**
33
- * Looks up the scopes for the given endpoint from the protectedResourceMap
34
- * @param endpoint Url of the request
35
- * @param httpMethod Http method of the request
36
- * @returns Array of scopes, or null if not found
37
- *
38
- */
39
- private getScopesForEndpoint;
40
- /**
41
- * Finds resource endpoints that match request endpoint
42
- * @param protectedResourcesEndpoints
43
- * @param endpoint
44
- * @returns
45
- */
46
- private matchResourcesToEndpoint;
47
- /**
48
- * Compares URL segments between key and endpoint
49
- * @param key
50
- * @param endpoint
51
- * @returns
52
- */
53
- private checkUrlComponents;
54
- /**
55
- * Transforms relative urls to absolute urls
56
- * @param url
57
- * @returns
58
- */
59
- private getAbsoluteUrl;
60
- /**
61
- * Finds scopes from first matching endpoint with HTTP method that matches request
62
- * @param protectedResourceMap Protected resource map
63
- * @param endpointArray Array of resources that match request endpoint
64
- * @param httpMethod Http method of the request
65
- * @returns
66
- */
67
- private matchScopesToEndpoint;
68
- static ɵfac: i0.ɵɵFactoryDeclaration<MsalInterceptor, never>;
69
- static ɵprov: i0.ɵɵInjectableDeclaration<MsalInterceptor>;
70
- }
1
+ import { Location } from "@angular/common";
2
+ import { HttpRequest, HttpHandler, HttpEvent, HttpInterceptor } from "@angular/common/http";
3
+ import { Observable } from "rxjs";
4
+ import { MsalService } from "./msal.service";
5
+ import { MsalInterceptorConfiguration } from "./msal.interceptor.config";
6
+ import { MsalBroadcastService } from "./msal.broadcast.service";
7
+ import * as i0 from "@angular/core";
8
+ export declare class MsalInterceptor implements HttpInterceptor {
9
+ private msalInterceptorConfig;
10
+ private authService;
11
+ private location;
12
+ private msalBroadcastService;
13
+ private _document?;
14
+ constructor(msalInterceptorConfig: MsalInterceptorConfiguration, authService: MsalService, location: Location, msalBroadcastService: MsalBroadcastService, document?: any);
15
+ intercept(req: HttpRequest<any>, // eslint-disable-line @typescript-eslint/no-explicit-any
16
+ next: HttpHandler): Observable<HttpEvent<any>>;
17
+ /**
18
+ * Try to acquire token silently. Invoke interaction if acquireTokenSilent rejected with error or resolved with null access token
19
+ * @param authRequest Request
20
+ * @param scopes Array of scopes for the request
21
+ * @param account Account
22
+ * @returns Authentication result
23
+ */
24
+ private acquireToken;
25
+ /**
26
+ * Invoke interaction for the given set of scopes
27
+ * @param authRequest Request
28
+ * @param scopes Array of scopes for the request
29
+ * @returns Result from the interactive request
30
+ */
31
+ private acquireTokenInteractively;
32
+ /**
33
+ * Looks up the scopes for the given endpoint from the protectedResourceMap
34
+ * @param endpoint Url of the request
35
+ * @param httpMethod Http method of the request
36
+ * @returns Array of scopes, or null if not found
37
+ *
38
+ */
39
+ private getScopesForEndpoint;
40
+ /**
41
+ * Finds resource endpoints that match request endpoint
42
+ * @param protectedResourcesEndpoints
43
+ * @param endpoint
44
+ * @returns
45
+ */
46
+ private matchResourcesToEndpoint;
47
+ /**
48
+ * Compares URL segments between key and endpoint
49
+ * @param key
50
+ * @param endpoint
51
+ * @returns
52
+ */
53
+ private checkUrlComponents;
54
+ /**
55
+ * Transforms relative urls to absolute urls
56
+ * @param url
57
+ * @returns
58
+ */
59
+ private getAbsoluteUrl;
60
+ /**
61
+ * Finds scopes from first matching endpoint with HTTP method that matches request
62
+ * @param protectedResourceMap Protected resource map
63
+ * @param endpointArray Array of resources that match request endpoint
64
+ * @param httpMethod Http method of the request
65
+ * @returns
66
+ */
67
+ private matchScopesToEndpoint;
68
+ /**
69
+ * Tests if a given string matches a given pattern, with support for wildcards and queries.
70
+ * @param pattern Wildcard pattern to string match. Supports "*" for wildcards and "?" for queries
71
+ * @param input String to match against
72
+ */
73
+ private matchPattern;
74
+ static ɵfac: i0.ɵɵFactoryDeclaration<MsalInterceptor, never>;
75
+ static ɵprov: i0.ɵɵInjectableDeclaration<MsalInterceptor>;
76
+ }
package/msal.module.d.ts CHANGED
@@ -1,13 +1,13 @@
1
- import { ModuleWithProviders } from "@angular/core";
2
- import { IPublicClientApplication } from "@azure/msal-browser";
3
- import { MsalGuardConfiguration } from "./msal.guard.config";
4
- import { MsalInterceptorConfiguration } from "./msal.interceptor.config";
5
- import * as i0 from "@angular/core";
6
- import * as i1 from "./msal.redirect.component";
7
- import * as i2 from "@angular/common";
8
- export declare class MsalModule {
9
- static forRoot(msalInstance: IPublicClientApplication, guardConfig: MsalGuardConfiguration, interceptorConfig: MsalInterceptorConfiguration): ModuleWithProviders<MsalModule>;
10
- static ɵfac: i0.ɵɵFactoryDeclaration<MsalModule, never>;
11
- static ɵmod: i0.ɵɵNgModuleDeclaration<MsalModule, [typeof i1.MsalRedirectComponent], [typeof i2.CommonModule], never>;
12
- static ɵinj: i0.ɵɵInjectorDeclaration<MsalModule>;
13
- }
1
+ import { ModuleWithProviders } from "@angular/core";
2
+ import { IPublicClientApplication } from "@azure/msal-browser";
3
+ import { MsalGuardConfiguration } from "./msal.guard.config";
4
+ import { MsalInterceptorConfiguration } from "./msal.interceptor.config";
5
+ import * as i0 from "@angular/core";
6
+ import * as i1 from "./msal.redirect.component";
7
+ import * as i2 from "@angular/common";
8
+ export declare class MsalModule {
9
+ static forRoot(msalInstance: IPublicClientApplication, guardConfig: MsalGuardConfiguration, interceptorConfig: MsalInterceptorConfiguration): ModuleWithProviders<MsalModule>;
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<MsalModule, never>;
11
+ static ɵmod: i0.ɵɵNgModuleDeclaration<MsalModule, [typeof i1.MsalRedirectComponent], [typeof i2.CommonModule], never>;
12
+ static ɵinj: i0.ɵɵInjectorDeclaration<MsalModule>;
13
+ }
@@ -1,19 +1,19 @@
1
- import { Location } from "@angular/common";
2
- import { Router } from "@angular/router";
3
- import { NavigationClient, NavigationOptions } from "@azure/msal-browser";
4
- import { MsalService } from "./msal.service";
5
- import * as i0 from "@angular/core";
6
- /**
7
- * Custom navigation used for Angular client-side navigation.
8
- * See performance doc for details:
9
- * https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-angular/docs/performance.md
10
- */
11
- export declare class MsalCustomNavigationClient extends NavigationClient {
12
- private authService;
13
- private router;
14
- private location;
15
- constructor(authService: MsalService, router: Router, location: Location);
16
- navigateInternal(url: string, options: NavigationOptions): Promise<boolean>;
17
- static ɵfac: i0.ɵɵFactoryDeclaration<MsalCustomNavigationClient, never>;
18
- static ɵprov: i0.ɵɵInjectableDeclaration<MsalCustomNavigationClient>;
19
- }
1
+ import { Location } from "@angular/common";
2
+ import { Router } from "@angular/router";
3
+ import { NavigationClient, NavigationOptions } from "@azure/msal-browser";
4
+ import { MsalService } from "./msal.service";
5
+ import * as i0 from "@angular/core";
6
+ /**
7
+ * Custom navigation used for Angular client-side navigation.
8
+ * See performance doc for details:
9
+ * https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-angular/docs/performance.md
10
+ */
11
+ export declare class MsalCustomNavigationClient extends NavigationClient {
12
+ private authService;
13
+ private router;
14
+ private location;
15
+ constructor(authService: MsalService, router: Router, location: Location);
16
+ navigateInternal(url: string, options: NavigationOptions): Promise<boolean>;
17
+ static ɵfac: i0.ɵɵFactoryDeclaration<MsalCustomNavigationClient, never>;
18
+ static ɵprov: i0.ɵɵInjectableDeclaration<MsalCustomNavigationClient>;
19
+ }
@@ -1,15 +1,15 @@
1
- /**
2
- * This is a dedicated redirect component to be added to Angular apps to
3
- * handle redirects when using @azure/msal-angular.
4
- * Import this component to use redirects in your app.
5
- */
6
- import { OnInit } from "@angular/core";
7
- import { MsalService } from "./msal.service";
8
- import * as i0 from "@angular/core";
9
- export declare class MsalRedirectComponent implements OnInit {
10
- private authService;
11
- constructor(authService: MsalService);
12
- ngOnInit(): void;
13
- static ɵfac: i0.ɵɵFactoryDeclaration<MsalRedirectComponent, never>;
14
- static ɵcmp: i0.ɵɵComponentDeclaration<MsalRedirectComponent, "app-redirect", never, {}, {}, never, never, false, never>;
15
- }
1
+ /**
2
+ * This is a dedicated redirect component to be added to Angular apps to
3
+ * handle redirects when using @azure/msal-angular.
4
+ * Import this component to use redirects in your app.
5
+ */
6
+ import { OnInit } from "@angular/core";
7
+ import { MsalService } from "./msal.service";
8
+ import * as i0 from "@angular/core";
9
+ export declare class MsalRedirectComponent implements OnInit {
10
+ private authService;
11
+ constructor(authService: MsalService);
12
+ ngOnInit(): void;
13
+ static ɵfac: i0.ɵɵFactoryDeclaration<MsalRedirectComponent, never>;
14
+ static ɵcmp: i0.ɵɵComponentDeclaration<MsalRedirectComponent, "app-redirect", never, {}, {}, never, never, false, never>;
15
+ }