@odx/auth 1.0.0-alpha.1 → 1.0.0-rc.1

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 (48) hide show
  1. package/esm2020/index.mjs +6 -3
  2. package/esm2020/lib/auth-error-handler.mjs +20 -0
  3. package/esm2020/lib/auth.component.mjs +13 -21
  4. package/esm2020/lib/auth.config.mjs +11 -3
  5. package/esm2020/lib/auth.directive.mjs +41 -0
  6. package/esm2020/lib/auth.guard.mjs +18 -0
  7. package/esm2020/lib/auth.module.mjs +10 -12
  8. package/esm2020/lib/auth.providers.mjs +53 -42
  9. package/esm2020/lib/auth.service.mjs +87 -21
  10. package/esm2020/lib/auth.typings.mjs +2 -0
  11. package/esm2020/lib/directives/sign-in.directive.mjs +6 -6
  12. package/esm2020/lib/directives/sign-out.directive.mjs +6 -6
  13. package/esm2020/lib/helpers/create-inititals.mjs +12 -0
  14. package/esm2020/lib/helpers/index.mjs +3 -3
  15. package/esm2020/lib/helpers/parse-identity-claims.mjs +10 -0
  16. package/esm2020/lib/models/authorized-handler.mjs +2 -0
  17. package/esm2020/lib/models/index.mjs +2 -2
  18. package/fesm2015/odx-auth.mjs +255 -134
  19. package/fesm2015/odx-auth.mjs.map +1 -1
  20. package/fesm2020/odx-auth.mjs +252 -135
  21. package/fesm2020/odx-auth.mjs.map +1 -1
  22. package/index.d.ts +5 -2
  23. package/lib/auth-error-handler.d.ts +12 -0
  24. package/lib/auth.component.d.ts +2 -3
  25. package/lib/auth.config.d.ts +11 -6
  26. package/lib/auth.directive.d.ts +15 -0
  27. package/lib/auth.guard.d.ts +3 -0
  28. package/lib/auth.module.d.ts +4 -4
  29. package/lib/auth.providers.d.ts +9 -6
  30. package/lib/auth.service.d.ts +27 -11
  31. package/lib/auth.typings.d.ts +19 -0
  32. package/lib/directives/sign-in.directive.d.ts +3 -3
  33. package/lib/directives/sign-out.directive.d.ts +3 -3
  34. package/lib/helpers/create-inititals.d.ts +1 -0
  35. package/lib/helpers/index.d.ts +2 -2
  36. package/lib/helpers/parse-identity-claims.d.ts +1 -0
  37. package/lib/models/auth-environment.d.ts +1 -1
  38. package/lib/models/authorized-handler.d.ts +4 -0
  39. package/lib/models/index.d.ts +1 -1
  40. package/package.json +3 -4
  41. package/esm2020/lib/auth.interceptor.mjs +0 -25
  42. package/esm2020/lib/helpers/get-user-initials.mjs +0 -12
  43. package/esm2020/lib/helpers/resolve-issuer.mjs +0 -13
  44. package/esm2020/lib/models/user.mjs +0 -2
  45. package/lib/auth.interceptor.d.ts +0 -11
  46. package/lib/helpers/get-user-initials.d.ts +0 -2
  47. package/lib/helpers/resolve-issuer.d.ts +0 -2
  48. package/lib/models/user.d.ts +0 -4
@@ -1 +1 @@
1
- {"version":3,"file":"odx-auth.mjs","sources":["../../../../libs/auth/src/lib/auth.config.ts","../../../../libs/auth/src/lib/auth.service.ts","../../../../libs/auth/src/lib/directives/sign-in.directive.ts","../../../../libs/auth/src/lib/directives/sign-out.directive.ts","../../../../libs/auth/src/lib/helpers/get-user-initials.ts","../../../../libs/auth/src/lib/helpers/resolve-issuer.ts","../../../../libs/auth/src/lib/auth.component.ts","../../../../libs/auth/src/lib/auth.component.html","../../../../libs/auth/src/lib/auth.interceptor.ts","../../../../libs/auth/src/lib/auth.providers.ts","../../../../libs/auth/src/lib/auth.module.ts","../../../../libs/auth/src/odx-auth.ts"],"sourcesContent":["import { createModuleConfigTokens } from '@odx/angular/utils';\n\nimport { OktaAuthOptions } from '@okta/okta-auth-js';\nimport { AuthEnvironment } from './models';\n\nexport const DEFAULT_AUTH_SCOPES = ['openid', 'profile'];\n\nexport interface AuthModuleConfig extends Pick<OktaAuthOptions, 'clientId' | 'scopes'> {\n environment: AuthEnvironment;\n redirectPath: string;\n signUpUrl?: string;\n disallowedOrigins: string[];\n postLogoutRedirectPath?: string;\n issuerOverride?: string;\n}\n\nexport const { AuthDefaultModuleConfig, AuthModuleConfig, injectAuthModuleConfig } = createModuleConfigTokens('Auth', '@odx/auth', {\n environment: 'prod',\n redirectPath: 'login/callback',\n disallowedOrigins: [],\n} as AuthModuleConfig);\n","import { inject, Injectable } from '@angular/core';\nimport { OktaAuthStateService, OKTA_AUTH } from '@okta/okta-angular';\nimport { map, Observable, shareReplay } from 'rxjs';\nimport { User } from './models';\n\n@Injectable({ providedIn: 'root' })\nexport class AuthService {\n private readonly auth = inject(OKTA_AUTH);\n private readonly authState = inject(OktaAuthStateService);\n\n public readonly isAuthenticated$ = this.authState.authState$.pipe(\n map(({ isAuthenticated }) => !!isAuthenticated),\n shareReplay({ refCount: true })\n );\n public readonly user$: Observable<User | null> = this.authState.authState$.pipe(\n map(({ idToken }) => idToken?.claims ?? null),\n shareReplay({ refCount: true })\n );\n\n public async signIn(): Promise<void> {\n await this.auth.signInWithRedirect();\n }\n\n public async signOut(): Promise<void> {\n await this.auth.signOut();\n }\n\n public getAccessToken(): string | null {\n return this.auth.getAccessToken() ?? null;\n }\n\n public getRefreshToken(): string | null {\n return this.auth.getRefreshToken() ?? null;\n }\n\n public getAuthHeader(): { Authorization: `Bearer ${string}` } {\n return { Authorization: `Bearer ${this.getAccessToken()}` };\n }\n\n public hasAnyGroups$(groups: string | string[] | Record<string, string[]>): Observable<boolean> {\n return this.authState.hasAnyGroups(groups);\n }\n}\n","import { Directive, EventEmitter, HostListener, inject, OnInit, Output } from '@angular/core';\nimport { LoadingSpinnerDirective } from '@odx/angular/components/loading-spinner';\nimport { AuthService } from '../auth.service';\n\n@Directive({\n standalone: true,\n selector: '[odxButton][odxAuthSignIn]',\n hostDirectives: [LoadingSpinnerDirective],\n})\nexport class SignInDirective implements OnInit {\n private readonly authService = inject(AuthService);\n private readonly loadingSpinnerDirective = inject(LoadingSpinnerDirective, { self: true });\n\n // eslint-disable-next-line @angular-eslint/no-output-rename\n @Output('odxAuthSignIn')\n public afterSignIn = new EventEmitter<void>();\n\n public ngOnInit(): void {\n this.loadingSpinnerDirective.autoColor = true;\n }\n\n @HostListener('click')\n protected async signIn(): Promise<void> {\n this.loadingSpinnerDirective.isLoading = true;\n await this.authService.signIn();\n this.afterSignIn.emit();\n }\n}\n","import { Directive, EventEmitter, HostListener, inject, OnInit, Output } from '@angular/core';\nimport { LoadingSpinnerDirective } from '@odx/angular/components/loading-spinner';\nimport { AuthService } from '../auth.service';\n\n@Directive({\n standalone: true,\n selector: '[odxButton][odxAuthSignOut]',\n hostDirectives: [LoadingSpinnerDirective],\n})\nexport class SignOutDirective implements OnInit {\n private readonly authService = inject(AuthService);\n private readonly loadingSpinnerDirective = inject(LoadingSpinnerDirective, { self: true });\n\n // eslint-disable-next-line @angular-eslint/no-output-rename\n @Output('odxAuthSignOut')\n public afterSignOut = new EventEmitter<void>();\n\n public ngOnInit(): void {\n this.loadingSpinnerDirective.autoColor = true;\n }\n\n @HostListener('click')\n protected async signIn(): Promise<void> {\n this.loadingSpinnerDirective.isLoading = true;\n await this.authService.signOut();\n this.afterSignOut.emit();\n }\n}\n","import { User } from '../models';\n\nexport function getUserInitials(user?: User | null): string {\n if (!user?.name) return '';\n const names = user.name.trim().split(' ');\n\n return names.reduce((initials, curr, index) => {\n if (index === 0 || index === names.length - 1) {\n initials = `${initials}${curr.charAt(0).toUpperCase()}`;\n }\n return initials;\n }, '');\n}\n","import { AuthEnvironment } from '../models';\n\nexport function resolveIssuer(environment: AuthEnvironment, issuerOverride?: string | null): string {\n if (issuerOverride) return issuerOverride;\n switch (environment) {\n case 'dev':\n return 'https://dev.login.draeger.com/oauth2/default';\n case 'stage':\n return 'https://test.login.draeger.com/oauth2/default';\n default:\n return 'https://login.draeger.com/oauth2/default';\n }\n}\n","import { ChangeDetectionStrategy, Component, inject, Input, ViewEncapsulation } from '@angular/core';\nimport { CoreModule } from '@odx/angular';\nimport { AreaHeaderModule } from '@odx/angular/components/area-header';\nimport { DropdownModule } from '@odx/angular/components/dropdown';\nimport { HeaderModule } from '@odx/angular/components/header';\nimport { LogoDirective } from '@odx/angular/components/logo';\nimport { Pure } from '@odx/angular/utils';\nimport { injectAuthModuleConfig } from './auth.config';\nimport { AuthService } from './auth.service';\nimport { SignInDirective, SignOutDirective } from './directives';\nimport { getUserInitials } from './helpers';\nimport { User } from './models';\n\n@Component({\n standalone: true,\n selector: 'odx-auth',\n imports: [CoreModule, AreaHeaderModule, DropdownModule, HeaderModule, LogoDirective, SignInDirective, SignOutDirective],\n templateUrl: './auth.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class AuthComponent {\n protected readonly config = injectAuthModuleConfig();\n protected readonly authService = inject(AuthService);\n\n @Input()\n public signInButtonText = 'Sign in';\n\n @Input()\n public signOutButtonText = 'Sign out';\n\n @Pure\n public getInitials(user?: User | null): string {\n return getUserInitials(user);\n }\n}\n","<odx-action-group *odxLet=\"authService.user$ | async as user\">\n <ng-template [ngIf]=\"authService.isAuthenticated$ | async\" [ngIfElse]=\"notAuthenticated\">\n <button odxButton odxHeaderAvatar [odxDropdown]=\"userProfileMenu\">\n <odx-avatar>\n {{ getInitials(user) }}\n </odx-avatar>\n </button>\n </ng-template>\n <ng-template #notAuthenticated>\n <button class=\"odx-auth-sign-in\" odxButton odxAuthSignIn variant=\"primary\">\n <odx-icon name=\"user\" alignLeft></odx-icon>\n {{ signInButtonText }}\n </button>\n </ng-template>\n <ng-template #userProfileMenu>\n <odx-area-header class=\"odx-padding-x-12\" size=\"small\">\n <odx-avatar>\n {{ getInitials(user) }}\n </odx-avatar>\n <h2 class=\"odx-title\">{{ user?.name }}</h2>\n <h5 class=\"odx-subtitle\">{{ user?.email_address }}</h5>\n </odx-area-header>\n <ng-content></ng-content>\n <div class=\"odx-margin-top-12\" odxLayout=\"flex vertical-center\">\n <odx-logo odxLayout=\"auto\" class=\"odx-margin-left-12 odx-margin-right-auto\"></odx-logo>\n <button odxButton odxAuthSignOut variant=\"ghost\">\n {{ signOutButtonText }}\n <odx-icon name=\"arrow-right\" alignRight></odx-icon>\n </button>\n </div>\n </ng-template>\n</odx-action-group>\n","import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';\nimport { inject, Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { injectAuthModuleConfig } from './auth.config';\nimport { AuthService } from './auth.service';\n\n@Injectable()\nexport class AuthInterceptor implements HttpInterceptor {\n private readonly config = injectAuthModuleConfig();\n private readonly authService = inject(AuthService);\n\n public intercept(request: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>> {\n return next.handle(this.addAuthHeader(request));\n }\n\n private addAuthHeader(request: HttpRequest<unknown>): HttpRequest<unknown> {\n if (!this.config.disallowedOrigins.find((origin) => !!request.url.match(origin))) {\n return request.clone({ setHeaders: this.authService.getAuthHeader() });\n }\n return request;\n }\n}\n","import { HTTP_INTERCEPTORS } from '@angular/common/http';\nimport { APP_INITIALIZER, inject, Provider } from '@angular/core';\nimport {} from '@angular/platform-browser';\nimport { Router } from '@angular/router';\nimport { WindowRef } from '@odx/angular';\nimport { buildUrl } from '@odx/angular/utils';\nimport { OktaCallbackComponent, OktaConfig, OKTA_CONFIG } from '@okta/okta-angular';\nimport { OktaAuth } from '@okta/okta-auth-js';\nimport { DEFAULT_AUTH_SCOPES, injectAuthModuleConfig } from './auth.config';\nimport { AuthInterceptor } from './auth.interceptor';\nimport { resolveIssuer } from './helpers';\n\nexport function registerAuthCallbackRoute(): () => void {\n const { redirectPath } = injectAuthModuleConfig();\n const router = inject(Router);\n\n return () => {\n router.config.unshift({ path: redirectPath, component: OktaCallbackComponent });\n };\n}\n\nexport function initalizeAuthConfig(): OktaConfig {\n const { clientId, scopes, redirectPath, environment, postLogoutRedirectPath, issuerOverride } = injectAuthModuleConfig();\n const origin = inject(WindowRef).getOrigin();\n const postLogoutRedirectUri = postLogoutRedirectPath ? buildUrl(origin, postLogoutRedirectPath) : undefined;\n\n return {\n oktaAuth: new OktaAuth({\n issuer: resolveIssuer(environment, issuerOverride),\n clientId,\n redirectUri: buildUrl(origin, redirectPath),\n scopes: Array.from(new Set(DEFAULT_AUTH_SCOPES.concat(scopes ?? []))),\n pkce: true,\n devMode: environment === 'dev',\n postLogoutRedirectUri,\n }),\n };\n}\n\nexport default [\n {\n provide: APP_INITIALIZER,\n useFactory: registerAuthCallbackRoute,\n multi: true,\n },\n {\n provide: OKTA_CONFIG,\n useFactory: initalizeAuthConfig,\n },\n {\n provide: HTTP_INTERCEPTORS,\n useClass: AuthInterceptor,\n multi: true,\n },\n] as Provider[];\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { ModuleConfigDependencies, ModuleConfigProvider, provideModuleConfig } from '@odx/angular/utils';\nimport { OktaAuthModule } from '@okta/okta-angular';\nimport { AuthComponent } from './auth.component';\nimport { AuthModuleConfig } from './auth.config';\nimport authProviders from './auth.providers';\nimport { SignInDirective, SignOutDirective } from './directives';\n\nconst modules = [AuthComponent, SignInDirective, SignOutDirective];\n\n@NgModule({\n imports: [...modules],\n exports: [OktaAuthModule, ...modules],\n})\nexport class AuthModule {\n public static forRoot<D extends ModuleConfigDependencies>(config: ModuleConfigProvider<Partial<AuthModuleConfig>, D>): ModuleWithProviders<AuthModule> {\n return {\n ngModule: AuthModule,\n providers: [provideModuleConfig(AuthModuleConfig, config), ...authProviders],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;MAKa,mBAAmB,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAE;AAWlD,MAAM,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,GAAG,wBAAwB,CAAC,MAAM,EAAE,WAAW,EAAE;AACjI,IAAA,WAAW,EAAE,MAAM;AACnB,IAAA,YAAY,EAAE,gBAAgB;AAC9B,IAAA,iBAAiB,EAAE,EAAE;AACF,CAAA;;MCdR,WAAW,CAAA;AADxB,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,SAAS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a,EAAE,eAAe,EAAE,gBAAgB,CAAA,EAAA,CAAA,CAAA;wGAMpD,UAAU,EAAA,OAAA,EAAA,CANN,aAAa,EAIlB,cAAc,CAAA,EAAA,CAAA,CAAA;2FAEb,UAAU,EAAA,UAAA,EAAA,CAAA;kBAJtB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC;AACrB,oBAAA,OAAO,EAAE,CAAC,cAAc,EAAE,GAAG,OAAO,CAAC;AACtC,iBAAA,CAAA;;;ACbD;;AAEG;;;;"}
1
+ {"version":3,"file":"odx-auth.mjs","sources":["../../../../libs/auth/src/lib/auth-error-handler.ts","../../../../libs/auth/src/lib/auth.config.ts","../../../../libs/auth/src/lib/helpers/create-inititals.ts","../../../../libs/auth/src/lib/helpers/parse-identity-claims.ts","../../../../libs/auth/src/lib/auth.service.ts","../../../../libs/auth/src/lib/directives/sign-in.directive.ts","../../../../libs/auth/src/lib/directives/sign-out.directive.ts","../../../../libs/auth/src/lib/auth.component.ts","../../../../libs/auth/src/lib/auth.component.html","../../../../libs/auth/src/lib/auth.directive.ts","../../../../libs/auth/src/lib/auth.guard.ts","../../../../libs/auth/src/lib/auth.providers.ts","../../../../libs/auth/src/lib/auth.module.ts","../../../../libs/auth/src/odx-auth.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { OAuthErrorEvent } from 'angular-oauth2-oidc';\n\n@Injectable()\nexport abstract class AuthErrorHandler {\n public abstract handleError(error: OAuthErrorEvent): void;\n}\n\n@Injectable()\nexport class NoopAuthErrorHandler extends AuthErrorHandler {\n public handleError(error: OAuthErrorEvent): void {\n throw error;\n }\n}\n","import { createModuleConfigTokens } from '@odx/angular/utils';\n\nimport { AuthEnvironment } from './models';\n\nexport const DEFAULT_AUTH_SCOPES = ['openid', 'profile', 'email', 'offline_access'];\nexport const DEFAULT_ISSUERS: Record<AuthEnvironment, string> = {\n dev: 'https://dev.login.draeger.com/oauth2/default',\n stage: 'https://test.login.draeger.com/oauth2/default',\n prod: 'https://login.draeger.com/oauth2/default',\n};\n\nexport interface AuthModuleConfig {\n environment: AuthEnvironment;\n clientId?: string;\n issuer?: string;\n redirectPath: string;\n allowedUrls: Array<string | RegExp>;\n timeoutFactor: number;\n maxOfflineTime: number;\n loadUserProfile: boolean;\n postLogoutRedirectUrl?: string;\n scopes?: string[];\n discoveryUrl?: string;\n}\n\nexport const { AuthDefaultModuleConfig, AuthModuleConfig, injectAuthModuleConfig } = createModuleConfigTokens('Auth', '@odx/auth', {\n environment: 'prod',\n redirectPath: 'login/callback',\n allowedUrls: [],\n timeoutFactor: 0.75,\n maxOfflineTime: 24 * 60 * 60, // 1 day\n loadUserProfile: false,\n} as AuthModuleConfig);\n","export function createInititals(value?: string | null): string {\n if (!value) return '';\n const parts = value.trim().split(' ');\n\n return parts.reduce((initials, curr, index) => {\n if (index === 0 || index === parts.length - 1) {\n initials = `${initials}${curr.charAt(0).toUpperCase()}`;\n }\n return initials;\n }, '');\n}\n","import { createInititals } from './create-inititals';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function parseIdentityClaims(identityClaims: any): OdxAuth.IdentiyClaims {\n return {\n ...identityClaims,\n email: identityClaims?.email ?? identityClaims.email_address ?? identityClaims.emails?.[0],\n initials: createInititals(identityClaims.name),\n };\n}\n","import { inject, Injectable, OnDestroy } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { WindowRef } from '@odx/angular';\nimport { AuthConfig, OAuthErrorEvent, OAuthService } from 'angular-oauth2-oidc';\nimport {\n BehaviorSubject,\n combineLatest,\n distinctUntilChanged,\n filter,\n fromEvent,\n map,\n merge,\n Observable,\n share,\n shareReplay,\n startWith,\n Subscription,\n switchMap,\n tap,\n} from 'rxjs';\nimport { AuthErrorHandler } from './auth-error-handler';\nimport { injectAuthModuleConfig } from './auth.config';\nimport { parseIdentityClaims } from './helpers/parse-identity-claims';\nimport { AuthorizedHandler } from './models';\n\n@Injectable({ providedIn: 'root' })\nexport class AuthService implements OnDestroy {\n private readonly subscription: Subscription;\n private readonly authConfig = injectAuthModuleConfig();\n private readonly errorHandler = inject(AuthErrorHandler);\n private readonly oauthService = inject(OAuthService);\n private readonly router = inject(Router);\n private readonly windowRef = inject(WindowRef);\n\n private readonly isInitialized$$ = new BehaviorSubject<boolean>(false);\n private readonly onAccessTokenUpdate$ = fromEvent<StorageEvent>(this.windowRef.nativeWindow, 'storage').pipe(\n filter(({ key }) => key === 'access_token' || key === null),\n startWith(null),\n share()\n );\n private readonly onAuthStateChange$ = combineLatest([this.oauthService.events.pipe(startWith(null)), this.windowRef.isOnline$, this.onAccessTokenUpdate$]);\n\n public readonly isAuthenticated$ = this.isInitialized$$.pipe(\n filter(Boolean),\n switchMap(() => this.onAuthStateChange$),\n map(() => this.isAuthenticated()),\n distinctUntilChanged(),\n shareReplay({ refCount: true })\n );\n public readonly identityClaims$: Observable<OdxAuth.IdentiyClaims | null> = this.isAuthenticated$.pipe(\n map(() => this.getIdentityClaims()),\n shareReplay({ refCount: true })\n );\n public readonly errors$ = this.oauthService.events.pipe(\n filter((event): event is OAuthErrorEvent => event instanceof OAuthErrorEvent),\n share()\n );\n\n constructor() {\n this.subscription = merge(\n this.errors$.pipe(\n tap((error) => {\n this.errorHandler.handleError(error);\n })\n ),\n this.windowRef.isOnline$.pipe(\n tap((isOnline) => {\n if (isOnline) {\n this.oauthService.setupAutomaticSilentRefresh();\n } else {\n this.oauthService.stopAutomaticRefresh();\n }\n })\n )\n ).subscribe();\n }\n\n public ngOnDestroy(): void {\n this.subscription.unsubscribe();\n }\n\n public async initialize(config: AuthConfig): Promise<void> {\n this.oauthService.configure(config);\n try {\n await this.oauthService.loadDiscoveryDocument(this.authConfig.discoveryUrl);\n await this.oauthService.tryLoginCodeFlow();\n if (this.getRefreshToken() && !this.isAuthenticated()) {\n await this.oauthService.refreshToken();\n }\n this.isInitialized$$.next(true);\n if (this.authConfig.loadUserProfile && this.oauthService.hasValidAccessToken()) {\n await this.loadUserProfile();\n }\n } catch {\n // ignore errors\n }\n if (this.oauthService.hasValidAccessToken()) {\n await this.routeToRequestedUrl();\n }\n }\n\n public signIn(url?: string): void {\n this.oauthService.initCodeFlow(url);\n }\n\n public signOut(): void {\n this.oauthService.logOut(!this.getAccessToken());\n }\n\n public async loadUserProfile(): Promise<void> {\n await this.oauthService.loadUserProfile();\n }\n\n public getAccessToken(): string | null {\n return this.oauthService.getAccessToken() ?? null;\n }\n\n public getRefreshToken(): string | null {\n return this.oauthService.getRefreshToken() ?? null;\n }\n\n public getIdToken(): string | null {\n return this.oauthService.getIdToken() ?? null;\n }\n\n public getIdentityClaims(): OdxAuth.IdentiyClaims | null {\n return this.getIdToken() ? parseIdentityClaims(this.oauthService.getIdentityClaims()) : null;\n }\n\n public isAuthenticated(): boolean {\n if (this.windowRef.isOnline()) {\n return this.oauthService.hasValidAccessToken() && this.oauthService.hasValidIdToken();\n }\n return this.hasValidOfflineToken();\n }\n\n public isAuthorized(authorizedHandler?: AuthorizedHandler | null): boolean {\n return this.isAuthenticated() && (authorizedHandler?.(this.getIdentityClaims(), this) ?? true);\n }\n\n private async routeToRequestedUrl(): Promise<void> {\n if (this.oauthService.state) {\n await this.router.navigateByUrl(decodeURIComponent(this.oauthService.state));\n }\n }\n\n private hasValidOfflineToken(): boolean {\n const issuedAt = this.getIdentityClaims()?.iat ?? 0;\n\n return Date.now() - issuedAt * 1000 <= this.authConfig.maxOfflineTime * 1000;\n }\n}\n","import { AfterViewInit, Directive, EventEmitter, HostListener, inject, Output } from '@angular/core';\nimport { LoadingSpinnerDirective } from '@odx/angular/components/loading-spinner';\nimport { AuthService } from '../auth.service';\n\n@Directive({\n standalone: true,\n selector: '[odxButton][odxAuthSignIn]',\n hostDirectives: [LoadingSpinnerDirective],\n})\nexport class SignInDirective implements AfterViewInit {\n private readonly authService = inject(AuthService);\n private readonly loadingSpinnerDirective = inject(LoadingSpinnerDirective, { self: true });\n\n // eslint-disable-next-line @angular-eslint/no-output-rename\n @Output('odxAuthSignIn')\n public afterSignIn = new EventEmitter<void>();\n\n public ngAfterViewInit(): void {\n this.loadingSpinnerDirective.autoColor = true;\n }\n\n @HostListener('click')\n protected async signIn(): Promise<void> {\n this.loadingSpinnerDirective.isLoading = true;\n this.authService.signIn();\n this.afterSignIn.emit();\n }\n}\n","import { AfterViewInit, Directive, EventEmitter, HostListener, inject, Output } from '@angular/core';\nimport { LoadingSpinnerDirective } from '@odx/angular/components/loading-spinner';\nimport { AuthService } from '../auth.service';\n\n@Directive({\n standalone: true,\n selector: '[odxButton][odxAuthSignOut]',\n hostDirectives: [LoadingSpinnerDirective],\n})\nexport class SignOutDirective implements AfterViewInit {\n private readonly authService = inject(AuthService);\n private readonly loadingSpinnerDirective = inject(LoadingSpinnerDirective, { self: true });\n\n // eslint-disable-next-line @angular-eslint/no-output-rename\n @Output('odxAuthSignOut')\n public afterSignOut = new EventEmitter<void>();\n\n public ngAfterViewInit(): void {\n this.loadingSpinnerDirective.autoColor = true;\n }\n\n @HostListener('click')\n protected async signIn(): Promise<void> {\n this.loadingSpinnerDirective.isLoading = true;\n this.authService.signOut();\n this.afterSignOut.emit();\n }\n}\n","import { ChangeDetectionStrategy, Component, inject, Input, ViewEncapsulation } from '@angular/core';\nimport { CoreModule } from '@odx/angular';\nimport { AreaHeaderModule } from '@odx/angular/components/area-header';\nimport { DropdownModule, DropdownOptions } from '@odx/angular/components/dropdown';\nimport { HeaderModule } from '@odx/angular/components/header';\nimport { LogoDirective } from '@odx/angular/components/logo';\nimport { Position } from '@odx/angular/utils';\nimport { AuthService } from './auth.service';\nimport { SignInDirective, SignOutDirective } from './directives';\n\n@Component({\n standalone: true,\n selector: 'odx-auth',\n imports: [CoreModule, AreaHeaderModule, DropdownModule, HeaderModule, LogoDirective, SignInDirective, SignOutDirective],\n templateUrl: './auth.component.html',\n styleUrls: ['./auth.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class AuthComponent {\n protected readonly authService = inject(AuthService);\n protected readonly dropdownOptions = {\n position: Position.BOTTOM_END,\n enableFallback: false,\n containerClass: 'odx-auth-user-profile',\n } as Partial<DropdownOptions>;\n\n @Input()\n public signInButtonText = 'Sign in';\n\n @Input()\n public signOutButtonText = 'Sign out';\n}\n","<odx-action-group *ngrxLet=\"{ idClaims: authService.identityClaims$, isAuthenticated: authService.isAuthenticated$ } as vm\">\n <ng-template [ngIf]=\"vm.isAuthenticated\" [ngIfElse]=\"notAuthenticated\">\n <button odxButton odxHeaderAvatar [odxDropdown]=\"userProfileMenu\" [odxDropdownOptions]=\"dropdownOptions\" data-testid=\"odx-auth-user-profile-button\">\n <ng-template [ngTemplateOutlet]=\"userAvatar\"></ng-template>\n </button>\n <ng-template #userProfileMenu>\n <odx-area-header class=\"odx-padding-x-12\" size=\"small\">\n <ng-template [ngTemplateOutlet]=\"userAvatar\" ngProjectAs=\"odx-avatar\"></ng-template>\n {{ vm.idClaims?.name }}\n <odx-area-header-subtitle>\n {{ vm.idClaims?.email }}\n </odx-area-header-subtitle>\n </odx-area-header>\n <ng-content></ng-content>\n <div class=\"odx-margin-top-12\" odxLayout=\"flex vertical-center\">\n <odx-logo odxLayout=\"auto\" class=\"odx-margin-left-12 odx-margin-right-auto\"></odx-logo>\n <button odxButton odxAuthSignOut variant=\"ghost\" data-testid=\"odx-auth-sign-out-button\">\n {{ signOutButtonText }}\n <odx-icon name=\"arrow-right\" alignRight></odx-icon>\n </button>\n </div>\n </ng-template>\n </ng-template>\n <ng-template #notAuthenticated>\n <button class=\"odx-auth-sign-in\" odxButton odxAuthSignIn variant=\"primary\" data-testid=\"odx-auth-sign-in-button\">\n <odx-icon name=\"user\" alignLeft></odx-icon>\n {{ signInButtonText }}\n </button>\n </ng-template>\n <ng-template #userAvatar>\n <odx-avatar class=\"odx-auth-user-avatar\">\n {{ vm.idClaims?.initials ?? '' }}\n </odx-avatar>\n </ng-template>\n</odx-action-group>\n","import { NgIf, NgIfContext } from '@angular/common';\nimport { AfterViewInit, Directive, inject, Input, TemplateRef } from '@angular/core';\nimport { isString, untilDestroyed } from '@odx/angular/utils';\nimport { AuthService } from './auth.service';\nimport { AuthorizedHandler } from './models';\n\n@Directive({\n standalone: true,\n selector: 'ng-template[odxAuth]',\n hostDirectives: [NgIf],\n})\nexport class AuthDirective implements AfterViewInit {\n private readonly authService = inject(AuthService);\n private readonly ngIfDirective = inject(NgIf, { host: true });\n private readonly takeUntilDestroyed = untilDestroyed();\n\n @Input('odxAuth')\n public authorizationHandler?: AuthorizedHandler | null | string = null;\n\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input('odxAuthElse')\n public set elseTemplate(value: TemplateRef<NgIfContext<unknown>>) {\n this.ngIfDirective.ngIfElse = value;\n }\n\n public ngAfterViewInit(): void {\n this.authService.isAuthenticated$.pipe(this.takeUntilDestroyed()).subscribe(() => {\n const handler = isString(this.authorizationHandler) ? null : this.authorizationHandler;\n this.ngIfDirective.ngIf = this.authService.isAuthorized(handler);\n });\n }\n}\n","import { inject } from '@angular/core';\nimport { CanActivateFn, Router } from '@angular/router';\nimport { map, take } from 'rxjs';\nimport { AuthService } from './auth.service';\nimport { AuthorizedHandlerWithRouter } from './models';\n\nexport function authGuard(authorizedHandler?: AuthorizedHandlerWithRouter): CanActivateFn {\n return (_, state) => {\n const authService = inject(AuthService);\n const router = inject(Router);\n const isAuthorized = () => authorizedHandler?.(authService.getIdentityClaims(), router, authService);\n\n return authService.isAuthenticated$.pipe(\n map((isAuthenticated) => {\n if (!isAuthenticated) {\n authService.signIn(state.url);\n }\n return isAuthorized() ?? isAuthenticated;\n }),\n take(1)\n );\n };\n}\n","import { APP_INITIALIZER, ClassProvider, EnvironmentProviders, inject, makeEnvironmentProviders, Type } from '@angular/core';\nimport { WindowRef } from '@odx/angular';\nimport { buildUrl, ModuleConfigDependencies, ModuleConfigProvider, provideModuleConfig } from '@odx/angular/utils';\nimport { OAuthModuleConfig, OAuthStorage, provideOAuthClient } from 'angular-oauth2-oidc';\nimport { AuthErrorHandler, NoopAuthErrorHandler } from './auth-error-handler';\nimport { AuthModuleConfig, DEFAULT_AUTH_SCOPES, DEFAULT_ISSUERS, injectAuthModuleConfig } from './auth.config';\nimport { AuthService } from './auth.service';\n\nexport function configureInterceptor(): OAuthModuleConfig {\n const { allowedUrls } = injectAuthModuleConfig();\n return {\n resourceServer: {\n customUrlValidation: (url) => allowedUrls.some((allowedUrl) => !!url.match(allowedUrl)),\n sendAccessToken: true,\n },\n };\n}\n\nexport function initalizeAuthConfig(): () => Promise<void> {\n const { clientId, scopes, redirectPath, environment, postLogoutRedirectUrl, issuer, timeoutFactor, discoveryUrl } = injectAuthModuleConfig();\n const authService = inject(AuthService);\n const origin = inject(WindowRef).getOrigin();\n const scope = Array.from(new Set(DEFAULT_AUTH_SCOPES.concat(scopes ?? []))).join(' ');\n\n return () =>\n authService.initialize({\n clientId,\n issuer: issuer ?? DEFAULT_ISSUERS[environment],\n scope,\n redirectUri: buildUrl(origin, redirectPath),\n postLogoutRedirectUri: postLogoutRedirectUrl,\n preserveRequestedRoute: true,\n strictDiscoveryDocumentValidation: !discoveryUrl,\n responseType: 'code',\n showDebugInformation: environment === 'dev',\n timeoutFactor,\n });\n}\n\nexport function provideAuthErrorHandler(errorHandler: Type<AuthErrorHandler>): ClassProvider {\n return {\n provide: AuthErrorHandler,\n useClass: errorHandler,\n };\n}\n\nexport function provideAuth<D extends ModuleConfigDependencies>(config: ModuleConfigProvider<Partial<AuthModuleConfig>, D>): EnvironmentProviders {\n return makeEnvironmentProviders([\n provideModuleConfig(AuthModuleConfig, config),\n provideOAuthClient(),\n provideAuthErrorHandler(NoopAuthErrorHandler),\n {\n provide: OAuthModuleConfig,\n useFactory: configureInterceptor,\n },\n {\n provide: APP_INITIALIZER,\n useFactory: initalizeAuthConfig,\n multi: true,\n },\n {\n provide: OAuthStorage,\n useFactory: () => inject(WindowRef).nativeWindow.localStorage,\n },\n ]);\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { ModuleConfigDependencies, ModuleConfigProvider } from '@odx/angular/utils';\nimport { AuthComponent } from './auth.component';\nimport { AuthModuleConfig } from './auth.config';\nimport { AuthDirective } from './auth.directive';\nimport { provideAuth } from './auth.providers';\nimport { SignInDirective, SignOutDirective } from './directives';\n\nconst modules = [AuthComponent, AuthDirective, SignInDirective, SignOutDirective];\n\n@NgModule({\n imports: [...modules],\n exports: [...modules],\n})\nexport class AuthModule {\n public static forRoot<D extends ModuleConfigDependencies>(config: ModuleConfigProvider<Partial<AuthModuleConfig>, D>): ModuleWithProviders<AuthModule> {\n return {\n ngModule: AuthModule,\n providers: [provideAuth(config)],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;MAIsB,gBAAgB,CAAA;;6GAAhB,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;iHAAhB,gBAAgB,EAAA,CAAA,CAAA;2FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBADrC,UAAU;;AAML,MAAO,oBAAqB,SAAQ,gBAAgB,CAAA;AACjD,IAAA,WAAW,CAAC,KAAsB,EAAA;AACvC,QAAA,MAAM,KAAK,CAAC;KACb;;iHAHU,oBAAoB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;qHAApB,oBAAoB,EAAA,CAAA,CAAA;2FAApB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBADhC,UAAU;;;ACJJ,MAAM,mBAAmB,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,gBAAgB,EAAE;AACvE,MAAA,eAAe,GAAoC;AAC9D,IAAA,GAAG,EAAE,8CAA8C;AACnD,IAAA,KAAK,EAAE,+CAA+C;AACtD,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zDA,MAAM,OAAO,GAAG,CAAC,aAAa,EAAE,aAAa,EAAE,eAAe,EAAE,gBAAgB,CAAC,CAAC;MAMrE,UAAU,CAAA;IACd,OAAO,OAAO,CAAqC,MAA0D,EAAA;QAClH,OAAO;AACL,YAAA,QAAQ,EAAE,UAAU;AACpB,YAAA,SAAS,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;SACjC,CAAC;KACH;;uGANU,UAAU,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAV,UAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAU,EANN,OAAA,EAAA,CAAA,aAAa,EAAE,aAAa,EAAE,eAAe,EAAE,gBAAgB,CAAA,EAAA,OAAA,EAAA,CAA/D,aAAa,EAAE,aAAa,EAAE,eAAe,EAAE,gBAAgB,CAAA,EAAA,CAAA,CAAA;AAMnE,UAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAU,YANN,aAAa,CAAA,EAAA,CAAA,CAAA;2FAMjB,UAAU,EAAA,UAAA,EAAA,CAAA;kBAJtB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC;AACrB,oBAAA,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC;AACtB,iBAAA,CAAA;;;ACbD;;AAEG;;;;"}
package/index.d.ts CHANGED
@@ -1,9 +1,12 @@
1
- export { OktaAuthGuard as AuthGuard } from '@okta/okta-angular';
1
+ export * from './lib/auth-error-handler';
2
2
  export * from './lib/auth.component';
3
3
  export * from './lib/auth.config';
4
- export * from './lib/auth.interceptor';
4
+ export * from './lib/auth.directive';
5
+ export * from './lib/auth.guard';
5
6
  export * from './lib/auth.module';
6
7
  export * from './lib/auth.providers';
7
8
  export * from './lib/auth.service';
9
+ export * from './lib/auth.typings';
8
10
  export * from './lib/directives';
9
11
  export * from './lib/helpers';
12
+ export * from './lib/models';
@@ -0,0 +1,12 @@
1
+ import { OAuthErrorEvent } from 'angular-oauth2-oidc';
2
+ import * as i0 from "@angular/core";
3
+ export declare abstract class AuthErrorHandler {
4
+ abstract handleError(error: OAuthErrorEvent): void;
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<AuthErrorHandler, never>;
6
+ static ɵprov: i0.ɵɵInjectableDeclaration<AuthErrorHandler>;
7
+ }
8
+ export declare class NoopAuthErrorHandler extends AuthErrorHandler {
9
+ handleError(error: OAuthErrorEvent): void;
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<NoopAuthErrorHandler, never>;
11
+ static ɵprov: i0.ɵɵInjectableDeclaration<NoopAuthErrorHandler>;
12
+ }
@@ -1,12 +1,11 @@
1
+ import { DropdownOptions } from '@odx/angular/components/dropdown';
1
2
  import { AuthService } from './auth.service';
2
- import { User } from './models';
3
3
  import * as i0 from "@angular/core";
4
4
  export declare class AuthComponent {
5
- protected readonly config: import("./auth.config").AuthModuleConfig;
6
5
  protected readonly authService: AuthService;
6
+ protected readonly dropdownOptions: Partial<DropdownOptions>;
7
7
  signInButtonText: string;
8
8
  signOutButtonText: string;
9
- getInitials(user?: User | null): string;
10
9
  static ɵfac: i0.ɵɵFactoryDeclaration<AuthComponent, never>;
11
10
  static ɵcmp: i0.ɵɵComponentDeclaration<AuthComponent, "odx-auth", never, { "signInButtonText": "signInButtonText"; "signOutButtonText": "signOutButtonText"; }, {}, never, ["*"], true, never>;
12
11
  }
@@ -1,12 +1,17 @@
1
- import { OktaAuthOptions } from '@okta/okta-auth-js';
2
1
  import { AuthEnvironment } from './models';
3
2
  export declare const DEFAULT_AUTH_SCOPES: string[];
4
- export interface AuthModuleConfig extends Pick<OktaAuthOptions, 'clientId' | 'scopes'> {
3
+ export declare const DEFAULT_ISSUERS: Record<AuthEnvironment, string>;
4
+ export interface AuthModuleConfig {
5
5
  environment: AuthEnvironment;
6
+ clientId?: string;
7
+ issuer?: string;
6
8
  redirectPath: string;
7
- signUpUrl?: string;
8
- disallowedOrigins: string[];
9
- postLogoutRedirectPath?: string;
10
- issuerOverride?: string;
9
+ allowedUrls: Array<string | RegExp>;
10
+ timeoutFactor: number;
11
+ maxOfflineTime: number;
12
+ loadUserProfile: boolean;
13
+ postLogoutRedirectUrl?: string;
14
+ scopes?: string[];
15
+ discoveryUrl?: string;
11
16
  }
12
17
  export declare const AuthDefaultModuleConfig: AuthModuleConfig, AuthModuleConfig: import("@angular/core").InjectionToken<Partial<AuthModuleConfig>>, injectAuthModuleConfig: () => AuthModuleConfig;
@@ -0,0 +1,15 @@
1
+ import { NgIfContext } from '@angular/common';
2
+ import { AfterViewInit, TemplateRef } from '@angular/core';
3
+ import { AuthorizedHandler } from './models';
4
+ import * as i0 from "@angular/core";
5
+ import * as i1 from "@angular/common";
6
+ export declare class AuthDirective implements AfterViewInit {
7
+ private readonly authService;
8
+ private readonly ngIfDirective;
9
+ private readonly takeUntilDestroyed;
10
+ authorizationHandler?: AuthorizedHandler | null | string;
11
+ set elseTemplate(value: TemplateRef<NgIfContext<unknown>>);
12
+ ngAfterViewInit(): void;
13
+ static ɵfac: i0.ɵɵFactoryDeclaration<AuthDirective, never>;
14
+ static ɵdir: i0.ɵɵDirectiveDeclaration<AuthDirective, "ng-template[odxAuth]", never, { "authorizationHandler": "odxAuth"; "elseTemplate": "odxAuthElse"; }, {}, never, never, true, [{ directive: typeof i1.NgIf; inputs: {}; outputs: {}; }]>;
15
+ }
@@ -0,0 +1,3 @@
1
+ import { CanActivateFn } from '@angular/router';
2
+ import { AuthorizedHandlerWithRouter } from './models';
3
+ export declare function authGuard(authorizedHandler?: AuthorizedHandlerWithRouter): CanActivateFn;
@@ -3,12 +3,12 @@ import { ModuleConfigDependencies, ModuleConfigProvider } from '@odx/angular/uti
3
3
  import { AuthModuleConfig } from './auth.config';
4
4
  import * as i0 from "@angular/core";
5
5
  import * as i1 from "./auth.component";
6
- import * as i2 from "./directives/sign-in.directive";
7
- import * as i3 from "./directives/sign-out.directive";
8
- import * as i4 from "@okta/okta-angular";
6
+ import * as i2 from "./auth.directive";
7
+ import * as i3 from "./directives/sign-in.directive";
8
+ import * as i4 from "./directives/sign-out.directive";
9
9
  export declare class AuthModule {
10
10
  static forRoot<D extends ModuleConfigDependencies>(config: ModuleConfigProvider<Partial<AuthModuleConfig>, D>): ModuleWithProviders<AuthModule>;
11
11
  static ɵfac: i0.ɵɵFactoryDeclaration<AuthModule, never>;
12
- static ɵmod: i0.ɵɵNgModuleDeclaration<AuthModule, never, [typeof i1.AuthComponent, typeof i2.SignInDirective, typeof i3.SignOutDirective], [typeof i4.OktaAuthModule, typeof i1.AuthComponent, typeof i2.SignInDirective, typeof i3.SignOutDirective]>;
12
+ static ɵmod: i0.ɵɵNgModuleDeclaration<AuthModule, never, [typeof i1.AuthComponent, typeof i2.AuthDirective, typeof i3.SignInDirective, typeof i4.SignOutDirective], [typeof i1.AuthComponent, typeof i2.AuthDirective, typeof i3.SignInDirective, typeof i4.SignOutDirective]>;
13
13
  static ɵinj: i0.ɵɵInjectorDeclaration<AuthModule>;
14
14
  }
@@ -1,6 +1,9 @@
1
- import { Provider } from '@angular/core';
2
- import { OktaConfig } from '@okta/okta-angular';
3
- export declare function registerAuthCallbackRoute(): () => void;
4
- export declare function initalizeAuthConfig(): OktaConfig;
5
- declare const _default: Provider[];
6
- export default _default;
1
+ import { ClassProvider, EnvironmentProviders, Type } from '@angular/core';
2
+ import { ModuleConfigDependencies, ModuleConfigProvider } from '@odx/angular/utils';
3
+ import { OAuthModuleConfig } from 'angular-oauth2-oidc';
4
+ import { AuthErrorHandler } from './auth-error-handler';
5
+ import { AuthModuleConfig } from './auth.config';
6
+ export declare function configureInterceptor(): OAuthModuleConfig;
7
+ export declare function initalizeAuthConfig(): () => Promise<void>;
8
+ export declare function provideAuthErrorHandler(errorHandler: Type<AuthErrorHandler>): ClassProvider;
9
+ export declare function provideAuth<D extends ModuleConfigDependencies>(config: ModuleConfigProvider<Partial<AuthModuleConfig>, D>): EnvironmentProviders;
@@ -1,19 +1,35 @@
1
+ import { OnDestroy } from '@angular/core';
2
+ import { AuthConfig, OAuthErrorEvent } from 'angular-oauth2-oidc';
1
3
  import { Observable } from 'rxjs';
2
- import { User } from './models';
4
+ import { AuthorizedHandler } from './models';
3
5
  import * as i0 from "@angular/core";
4
- export declare class AuthService {
5
- private readonly auth;
6
- private readonly authState;
6
+ export declare class AuthService implements OnDestroy {
7
+ private readonly subscription;
8
+ private readonly authConfig;
9
+ private readonly errorHandler;
10
+ private readonly oauthService;
11
+ private readonly router;
12
+ private readonly windowRef;
13
+ private readonly isInitialized$$;
14
+ private readonly onAccessTokenUpdate$;
15
+ private readonly onAuthStateChange$;
7
16
  readonly isAuthenticated$: Observable<boolean>;
8
- readonly user$: Observable<User | null>;
9
- signIn(): Promise<void>;
10
- signOut(): Promise<void>;
17
+ readonly identityClaims$: Observable<OdxAuth.IdentiyClaims | null>;
18
+ readonly errors$: Observable<OAuthErrorEvent>;
19
+ constructor();
20
+ ngOnDestroy(): void;
21
+ initialize(config: AuthConfig): Promise<void>;
22
+ signIn(url?: string): void;
23
+ signOut(): void;
24
+ loadUserProfile(): Promise<void>;
11
25
  getAccessToken(): string | null;
12
26
  getRefreshToken(): string | null;
13
- getAuthHeader(): {
14
- Authorization: `Bearer ${string}`;
15
- };
16
- hasAnyGroups$(groups: string | string[] | Record<string, string[]>): Observable<boolean>;
27
+ getIdToken(): string | null;
28
+ getIdentityClaims(): OdxAuth.IdentiyClaims | null;
29
+ isAuthenticated(): boolean;
30
+ isAuthorized(authorizedHandler?: AuthorizedHandler | null): boolean;
31
+ private routeToRequestedUrl;
32
+ private hasValidOfflineToken;
17
33
  static ɵfac: i0.ɵɵFactoryDeclaration<AuthService, never>;
18
34
  static ɵprov: i0.ɵɵInjectableDeclaration<AuthService>;
19
35
  }
@@ -0,0 +1,19 @@
1
+ declare global {
2
+ namespace OdxAuth {
3
+ interface IdentiyClaims {
4
+ sub: string;
5
+ oktaid: string;
6
+ iat: number;
7
+ name: string;
8
+ firstname: string;
9
+ lastname: string;
10
+ displayname: string;
11
+ preferred_username: string;
12
+ email: string;
13
+ initials: string;
14
+ locale?: string;
15
+ zoneinfo?: string;
16
+ }
17
+ }
18
+ }
19
+ export {};
@@ -1,11 +1,11 @@
1
- import { EventEmitter, OnInit } from '@angular/core';
1
+ import { AfterViewInit, EventEmitter } from '@angular/core';
2
2
  import * as i0 from "@angular/core";
3
3
  import * as i1 from "@odx/angular/components/loading-spinner";
4
- export declare class SignInDirective implements OnInit {
4
+ export declare class SignInDirective implements AfterViewInit {
5
5
  private readonly authService;
6
6
  private readonly loadingSpinnerDirective;
7
7
  afterSignIn: EventEmitter<void>;
8
- ngOnInit(): void;
8
+ ngAfterViewInit(): void;
9
9
  protected signIn(): Promise<void>;
10
10
  static ɵfac: i0.ɵɵFactoryDeclaration<SignInDirective, never>;
11
11
  static ɵdir: i0.ɵɵDirectiveDeclaration<SignInDirective, "[odxButton][odxAuthSignIn]", never, {}, { "afterSignIn": "odxAuthSignIn"; }, never, never, true, [{ directive: typeof i1.LoadingSpinnerDirective; inputs: {}; outputs: {}; }]>;
@@ -1,11 +1,11 @@
1
- import { EventEmitter, OnInit } from '@angular/core';
1
+ import { AfterViewInit, EventEmitter } from '@angular/core';
2
2
  import * as i0 from "@angular/core";
3
3
  import * as i1 from "@odx/angular/components/loading-spinner";
4
- export declare class SignOutDirective implements OnInit {
4
+ export declare class SignOutDirective implements AfterViewInit {
5
5
  private readonly authService;
6
6
  private readonly loadingSpinnerDirective;
7
7
  afterSignOut: EventEmitter<void>;
8
- ngOnInit(): void;
8
+ ngAfterViewInit(): void;
9
9
  protected signIn(): Promise<void>;
10
10
  static ɵfac: i0.ɵɵFactoryDeclaration<SignOutDirective, never>;
11
11
  static ɵdir: i0.ɵɵDirectiveDeclaration<SignOutDirective, "[odxButton][odxAuthSignOut]", never, {}, { "afterSignOut": "odxAuthSignOut"; }, never, never, true, [{ directive: typeof i1.LoadingSpinnerDirective; inputs: {}; outputs: {}; }]>;
@@ -0,0 +1 @@
1
+ export declare function createInititals(value?: string | null): string;
@@ -1,2 +1,2 @@
1
- export * from './get-user-initials';
2
- export * from './resolve-issuer';
1
+ export * from './create-inititals';
2
+ export * from './parse-identity-claims';
@@ -0,0 +1 @@
1
+ export declare function parseIdentityClaims(identityClaims: any): OdxAuth.IdentiyClaims;
@@ -1 +1 @@
1
- export declare type AuthEnvironment = 'dev' | 'stage' | 'prod';
1
+ export type AuthEnvironment = 'dev' | 'stage' | 'prod';
@@ -0,0 +1,4 @@
1
+ import { Router } from '@angular/router';
2
+ import { AuthService } from '../auth.service';
3
+ export type AuthorizedHandlerWithRouter = (identityClaims: OdxAuth.IdentiyClaims | null, router: Router, authService: AuthService) => boolean;
4
+ export type AuthorizedHandler = (identityClaims: OdxAuth.IdentiyClaims | null, authService: AuthService) => boolean;
@@ -1,2 +1,2 @@
1
1
  export * from './auth-environment';
2
- export * from './user';
2
+ export * from './authorized-handler';
package/package.json CHANGED
@@ -1,14 +1,13 @@
1
1
  {
2
2
  "name": "@odx/auth",
3
- "version": "1.0.0-alpha.1",
3
+ "version": "1.0.0-rc.1",
4
4
  "author": "Drägerwerk AG & Co.KGaA",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "peerDependencies": {
7
- "@odx/angular": ">=1.0.0-rc.12"
7
+ "@odx/angular": ">=1.0.0-rc.13"
8
8
  },
9
9
  "dependencies": {
10
- "@okta/okta-angular": "^6.0.0",
11
- "@okta/okta-auth-js": "^7.2.0",
10
+ "angular-oauth2-oidc": "^15.0.0",
12
11
  "tslib": "^2.5.0"
13
12
  },
14
13
  "publishConfig": {
@@ -1,25 +0,0 @@
1
- import { inject, Injectable } from '@angular/core';
2
- import { injectAuthModuleConfig } from './auth.config';
3
- import { AuthService } from './auth.service';
4
- import * as i0 from "@angular/core";
5
- export class AuthInterceptor {
6
- constructor() {
7
- this.config = injectAuthModuleConfig();
8
- this.authService = inject(AuthService);
9
- }
10
- intercept(request, next) {
11
- return next.handle(this.addAuthHeader(request));
12
- }
13
- addAuthHeader(request) {
14
- if (!this.config.disallowedOrigins.find((origin) => !!request.url.match(origin))) {
15
- return request.clone({ setHeaders: this.authService.getAuthHeader() });
16
- }
17
- return request;
18
- }
19
- }
20
- AuthInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.0", ngImport: i0, type: AuthInterceptor, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
21
- AuthInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.0", ngImport: i0, type: AuthInterceptor });
22
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.0", ngImport: i0, type: AuthInterceptor, decorators: [{
23
- type: Injectable
24
- }] });
25
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0aC5pbnRlcmNlcHRvci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL2xpYnMvYXV0aC9zcmMvbGliL2F1dGguaW50ZXJjZXB0b3IudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsT0FBTyxFQUFFLE1BQU0sRUFBRSxVQUFVLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFFbkQsT0FBTyxFQUFFLHNCQUFzQixFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQ3ZELE9BQU8sRUFBRSxXQUFXLEVBQUUsTUFBTSxnQkFBZ0IsQ0FBQzs7QUFHN0MsTUFBTSxPQUFPLGVBQWU7SUFENUI7UUFFbUIsV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2aWNlIH0gZnJvbSAnLi9hdXRoLnNlcnZpY2UnO1xuXG5ASW5qZWN0YWJsZSgpXG5leHBvcnQgY2xhc3MgQXV0aEludGVyY2VwdG9yIGltcGxlbWVudHMgSHR0cEludGVyY2VwdG9yIHtcbiAgcHJpdmF0ZSByZWFkb25seSBjb25maWcgPSBpbmplY3RBdXRoTW9kdWxlQ29uZmlnKCk7XG4gIHByaXZhdGUgcmVhZG9ubHkgYXV0aFNlcnZpY2UgPSBpbmplY3QoQXV0aFNlcnZpY2UpO1xuXG4gIHB1YmxpYyBpbnRlcmNlcHQocmVxdWVzdDogSHR0cFJlcXVlc3Q8dW5rbm93bj4sIG5leHQ6IEh0dHBIYW5kbGVyKTogT2JzZXJ2YWJsZTxIdHRwRXZlbnQ8dW5rbm93bj4+IHtcbiAgICByZXR1cm4gbmV4dC5oYW5kbGUodGhpcy5hZGRBdXRoSGVhZGVyKHJlcXVlc3QpKTtcbiAgfVxuXG4gIHByaXZhdGUgYWRkQXV0aEhlYWRlcihyZXF1ZXN0OiBIdHRwUmVxdWVzdDx1bmtub3duPik6IEh0dHBSZXF1ZXN0PHVua25vd24+IHtcbiAgICBpZiAoIXRoaXMuY29uZmlnLmRpc2FsbG93ZWRPcmlnaW5zLmZpbmQoKG9yaWdpbikgPT4gISFyZXF1ZXN0LnVybC5tYXRjaChvcmlnaW4pKSkge1xuICAgICAgcmV0dXJuIHJlcXVlc3QuY2xvbmUoeyBzZXRIZWFkZXJzOiB0aGlzLmF1dGhTZXJ2aWNlLmdldEF1dGhIZWFkZXIoKSB9KTtcbiAgICB9XG4gICAgcmV0dXJuIHJlcXVlc3Q7XG4gIH1cbn1cbiJdfQ==
@@ -1,12 +0,0 @@
1
- export function getUserInitials(user) {
2
- if (!user?.name)
3
- return '';
4
- const names = user.name.trim().split(' ');
5
- return names.reduce((initials, curr, index) => {
6
- if (index === 0 || index === names.length - 1) {
7
- initials = `${initials}${curr.charAt(0).toUpperCase()}`;
8
- }
9
- return initials;
10
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NvbnN0IG5hbWVzID0gdXNlci5uYW1lLnRyaW0oKS5zcGxpdCgnICcpO1xuXG4gIHJldHVybiBuYW1lcy5yZWR1Y2UoKGluaXRpYWxzLCBjdXJyLCBpbmRleCkgPT4ge1xuICAgIGlmIChpbmRleCA9PT0gMCB8fCBpbmRleCA9PT0gbmFtZXMubGVuZ3RoIC0gMSkge1xuICAgICAgaW5pdGlhbHMgPSBgJHtpbml0aWFsc30ke2N1cnIuY2hhckF0KDApLnRvVXBwZXJDYXNlKCl9YDtcbiAgICB9XG4gICAgcmV0dXJuIGluaXRpYWxzO1xuICB9LCAnJyk7XG59XG4iXX0=
@@ -1,13 +0,0 @@
1
- export function resolveIssuer(environment, issuerOverride) {
2
- if (issuerOverride)
3
- return issuerOverride;
4
- switch (environment) {
5
- case 'dev':
6
- return 'https://dev.login.draeger.com/oauth2/default';
7
- case 'stage':
8
- return 'https://test.login.draeger.com/oauth2/default';
9
- default:
10
- return 'https://login.draeger.com/oauth2/default';
11
- }
12
- }
13
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVzb2x2ZS1pc3N1ZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9saWJzL2F1dGgvc3JjL2xpYi9oZWxwZXJzL3Jlc29sdmUtaXNzdWVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVBLE1BQU0sVUFBVSxhQUFhLENBQUMsV0FBNEIsRUFBRSxjQUE4QjtJQUN4RixJQUFJLGNBQWM7UUFBRSxPQUFPLGNBQWMsQ0FBQztJQUMxQyxRQUFRLFdBQVcsRUFBRTtRQUNuQixLQUFLLEtBQUs7WUFDUixPQUFPLDhDQUE4QyxDQUFDO1FBQ3hELEtBQUssT0FBTztZQUNWLE9BQU8sK0NBQStDLENBQUM7UUFDekQ7WUFDRSxPQUFPLDBDQUEwQyxDQUFDO0tBQ3JEO0FBQ0gsQ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- import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';
2
- import { Observable } from 'rxjs';
3
- import * as i0 from "@angular/core";
4
- export declare class AuthInterceptor implements HttpInterceptor {
5
- private readonly config;
6
- private readonly authService;
7
- intercept(request: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>>;
8
- private addAuthHeader;
9
- static ɵfac: i0.ɵɵFactoryDeclaration<AuthInterceptor, never>;
10
- static ɵprov: i0.ɵɵInjectableDeclaration<AuthInterceptor>;
11
- }
@@ -1,2 +0,0 @@
1
- import { User } from '../models';
2
- export declare function getUserInitials(user?: User | null): string;
@@ -1,2 +0,0 @@
1
- import { AuthEnvironment } from '../models';
2
- export declare function resolveIssuer(environment: AuthEnvironment, issuerOverride?: string | null): string;
@@ -1,4 +0,0 @@
1
- import { UserClaims } from '@okta/okta-auth-js';
2
- export declare type User = UserClaims<{
3
- email_address?: string;
4
- }>;