@rxap/oauth 21.0.1 → 22.0.0-dev.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.
@@ -1,162 +1,154 @@
1
- import * as i0 from '@angular/core';
2
- import { inject, Injectable } from '@angular/core';
3
- import { RXAP_AUTHENTICATION_ACCESS_TOKEN, RXAP_AUTHENTICATION_DEACTIVATED, AuthenticationEventType, RxapAuthenticationService } from '@rxap/authentication';
4
- import { isDefined } from '@rxap/rxjs';
5
- import { OAuthService, AUTH_CONFIG } from 'angular-oauth2-oidc';
6
- import { JwksValidationHandler } from 'angular-oauth2-oidc-jwks';
7
- import { EMPTY, BehaviorSubject, Subject, distinctUntilChanged, startWith, firstValueFrom } from 'rxjs';
8
- import { map } from 'rxjs/operators';
9
-
10
- const JONE_DOE_JWT = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c';
11
- class AuthenticationService {
12
- constructor() {
13
- this.oauthService = inject(OAuthService);
14
- this.authConfig = inject(AUTH_CONFIG, { optional: true });
15
- this.authenticationAccessToken = inject(RXAP_AUTHENTICATION_ACCESS_TOKEN);
16
- this.isAuthDisabled = inject(RXAP_AUTHENTICATION_DEACTIVATED);
17
- this.events$ = EMPTY;
18
- this.isAuthenticated$ = new BehaviorSubject(null);
19
- /**
20
- * Is only used when authentication is disabled to emit the events
21
- * @private
22
- */
23
- this._events$ = new Subject();
24
- if (this.isAuthDisabled) {
25
- this.events$ = this._events$.asObservable();
26
- this.linkEventsAndIsAuthenticated();
27
- this._events$.next({
28
- type: AuthenticationEventType.OnAuthSuccess,
29
- payload: null,
30
- });
31
- this.authenticationAccessToken.next({
32
- token: JONE_DOE_JWT,
33
- valid: true,
34
- });
35
- }
36
- else {
37
- this.init();
38
- }
39
- }
40
- init() {
41
- if (this.authConfig) {
42
- this.oauthService.configure(this.authConfig);
43
- }
44
- this.events$ = this.oauthService.events.pipe(map(event => {
45
- switch (true) {
46
- case ['token_received', 'token_refreshed', 'silently_refreshed'].includes(event.type):
47
- this.authenticationAccessToken.next({
48
- token: this.oauthService.getAccessToken(),
49
- valid: this.oauthService.hasValidAccessToken(),
50
- });
51
- return {
52
- type: AuthenticationEventType.OnAuthSuccess,
53
- payload: event,
54
- };
55
- case event.type.endsWith('_error') ||
56
- ['silent_refresh_timeout', 'invalid_nonce_in_state'].includes(event.type):
57
- this.authenticationAccessToken.next(null);
58
- return {
59
- type: AuthenticationEventType.OnAuthError,
60
- payload: event,
61
- };
62
- case ['token_expires', 'logout', 'session_terminated'].includes(event.type):
63
- this.authenticationAccessToken.next(null);
64
- return {
65
- type: AuthenticationEventType.OnLogout,
66
- payload: event,
67
- };
68
- default:
69
- console.warn('Unhandled event', event);
70
- return null;
71
- }
72
- }), isDefined());
73
- this.linkEventsAndIsAuthenticated();
74
- // Use setStorage to use sessionStorage or another implementation of the TS-type Storage
75
- // instead of localStorage
76
- this.oauthService.setStorage(sessionStorage);
77
- if (this.oauthService.silentRefreshRedirectUri) {
78
- this.oauthService.setupAutomaticSilentRefresh();
79
- }
80
- this.oauthService.tokenValidationHandler = new JwksValidationHandler();
81
- this.oauthService.loadDiscoveryDocumentAndTryLogin().then(status => {
82
- this.isAuthenticated$.next(status);
83
- });
84
- }
85
- async signOut() {
86
- if (this.isAuthDisabled) {
87
- this._events$.next({
88
- type: AuthenticationEventType.OnLogout,
89
- payload: null,
90
- });
91
- }
92
- else {
93
- this.oauthService.logOut();
94
- }
95
- }
96
- signIn() {
97
- if (this.isAuthDisabled) {
98
- this._events$.next({
99
- type: AuthenticationEventType.OnAuthSuccess,
100
- payload: null,
101
- });
102
- }
103
- else {
104
- this.oauthService.initLoginFlow();
105
- }
106
- }
107
- linkEventsAndIsAuthenticated() {
108
- this.events$.pipe(map(event => event ? event.type === AuthenticationEventType.OnAuthSuccess : null), distinctUntilChanged(), startWith(null)).subscribe(this.isAuthenticated$);
109
- }
110
- isAuthenticated() {
111
- return firstValueFrom(this.isAuthenticated$.pipe(isDefined()));
112
- }
113
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AuthenticationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
114
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AuthenticationService }); }
115
- }
116
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AuthenticationService, decorators: [{
117
- type: Injectable
118
- }], ctorParameters: () => [] });
119
-
1
+ import * as i0 from "@angular/core";
2
+ import { Injectable, inject } from "@angular/core";
3
+ import { AuthenticationEventType, RXAP_AUTHENTICATION_ACCESS_TOKEN, RXAP_AUTHENTICATION_DEACTIVATED, RxapAuthenticationService } from "@rxap/authentication";
4
+ import { isDefined } from "@rxap/rxjs";
5
+ import { AUTH_CONFIG, OAuthService } from "angular-oauth2-oidc";
6
+ import { JwksValidationHandler } from "angular-oauth2-oidc-jwks";
7
+ import { BehaviorSubject, EMPTY, Subject, distinctUntilChanged, firstValueFrom, startWith } from "rxjs";
8
+ import { map } from "rxjs/operators";
9
+ const JONE_DOE_JWT = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c";
10
+ var AuthenticationService = class AuthenticationService {
11
+ constructor() {
12
+ this.oauthService = inject(OAuthService);
13
+ this.authConfig = inject(AUTH_CONFIG, { optional: true });
14
+ this.authenticationAccessToken = inject(RXAP_AUTHENTICATION_ACCESS_TOKEN);
15
+ this.isAuthDisabled = inject(RXAP_AUTHENTICATION_DEACTIVATED);
16
+ this.events$ = EMPTY;
17
+ this.isAuthenticated$ = new BehaviorSubject(null);
18
+ this._events$ = new Subject();
19
+ if (this.isAuthDisabled) {
20
+ this.events$ = this._events$.asObservable();
21
+ this.linkEventsAndIsAuthenticated();
22
+ this._events$.next({
23
+ type: AuthenticationEventType.OnAuthSuccess,
24
+ payload: null
25
+ });
26
+ this.authenticationAccessToken.next({
27
+ token: JONE_DOE_JWT,
28
+ valid: true
29
+ });
30
+ } else this.init();
31
+ }
32
+ init() {
33
+ if (this.authConfig) this.oauthService.configure(this.authConfig);
34
+ this.events$ = this.oauthService.events.pipe(map((event) => {
35
+ switch (true) {
36
+ case [
37
+ "token_received",
38
+ "token_refreshed",
39
+ "silently_refreshed"
40
+ ].includes(event.type):
41
+ this.authenticationAccessToken.next({
42
+ token: this.oauthService.getAccessToken(),
43
+ valid: this.oauthService.hasValidAccessToken()
44
+ });
45
+ return {
46
+ type: AuthenticationEventType.OnAuthSuccess,
47
+ payload: event
48
+ };
49
+ case event.type.endsWith("_error") || ["silent_refresh_timeout", "invalid_nonce_in_state"].includes(event.type):
50
+ this.authenticationAccessToken.next(null);
51
+ return {
52
+ type: AuthenticationEventType.OnAuthError,
53
+ payload: event
54
+ };
55
+ case [
56
+ "token_expires",
57
+ "logout",
58
+ "session_terminated"
59
+ ].includes(event.type):
60
+ this.authenticationAccessToken.next(null);
61
+ return {
62
+ type: AuthenticationEventType.OnLogout,
63
+ payload: event
64
+ };
65
+ default:
66
+ console.warn("Unhandled event", event);
67
+ return null;
68
+ }
69
+ }), isDefined());
70
+ this.linkEventsAndIsAuthenticated();
71
+ this.oauthService.setStorage(sessionStorage);
72
+ if (this.oauthService.silentRefreshRedirectUri) this.oauthService.setupAutomaticSilentRefresh();
73
+ this.oauthService.tokenValidationHandler = new JwksValidationHandler();
74
+ this.oauthService.loadDiscoveryDocumentAndTryLogin().then((status) => {
75
+ this.isAuthenticated$.next(status);
76
+ });
77
+ }
78
+ async signOut() {
79
+ if (this.isAuthDisabled) this._events$.next({
80
+ type: AuthenticationEventType.OnLogout,
81
+ payload: null
82
+ });
83
+ else this.oauthService.logOut();
84
+ }
85
+ signIn() {
86
+ if (this.isAuthDisabled) this._events$.next({
87
+ type: AuthenticationEventType.OnAuthSuccess,
88
+ payload: null
89
+ });
90
+ else this.oauthService.initLoginFlow();
91
+ }
92
+ linkEventsAndIsAuthenticated() {
93
+ this.events$.pipe(map((event) => event ? event.type === AuthenticationEventType.OnAuthSuccess : null), distinctUntilChanged(), startWith(null)).subscribe(this.isAuthenticated$);
94
+ }
95
+ isAuthenticated() {
96
+ return firstValueFrom(this.isAuthenticated$.pipe(isDefined()));
97
+ }
98
+ static {
99
+ this.ɵfac = i0.ɵɵngDeclareFactory({
100
+ minVersion: "12.0.0",
101
+ version: "22.3.0",
102
+ ngImport: i0,
103
+ type: AuthenticationService,
104
+ deps: [],
105
+ target: i0.ɵɵFactoryTarget.Injectable
106
+ });
107
+ }
108
+ static {
109
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
110
+ minVersion: "12.0.0",
111
+ version: "22.3.0",
112
+ ngImport: i0,
113
+ type: AuthenticationService
114
+ });
115
+ }
116
+ };
117
+ i0.ɵɵngDeclareClassMetadata({
118
+ minVersion: "12.0.0",
119
+ version: "22.3.0",
120
+ ngImport: i0,
121
+ type: AuthenticationService,
122
+ decorators: [{ type: Injectable }],
123
+ ctorParameters: () => []
124
+ });
120
125
  async function AuthenticationGuard(route, state) {
121
- const isAuthDisabled = inject(RXAP_AUTHENTICATION_DEACTIVATED, { optional: true }) ?? false;
122
- if (isAuthDisabled) {
123
- console.warn('Authentication is disabled!');
124
- return true;
125
- }
126
- const authService = inject(RxapAuthenticationService);
127
- if (!(authService instanceof AuthenticationService)) {
128
- throw new Error('The RxapAuthenticationService must be an instance of AuthenticationService. Ensure the ProvideAuth() function is used in the application config.');
129
- }
130
- if (await authService.isAuthenticated()) {
131
- return true;
132
- }
133
- authService.signIn();
134
- return false;
126
+ if (inject(RXAP_AUTHENTICATION_DEACTIVATED, { optional: true }) ?? false) {
127
+ console.warn("Authentication is disabled!");
128
+ return true;
129
+ }
130
+ const authService = inject(RxapAuthenticationService);
131
+ if (!(authService instanceof AuthenticationService)) throw new Error("The RxapAuthenticationService must be an instance of AuthenticationService. Ensure the ProvideAuth() function is used in the application config.");
132
+ if (await authService.isAuthenticated()) return true;
133
+ authService.signIn();
134
+ return false;
135
135
  }
136
-
137
136
  function ProvideAuth(...withConfigs) {
138
- return [
139
- AuthenticationService,
140
- {
141
- provide: RxapAuthenticationService,
142
- useExisting: AuthenticationService,
143
- },
144
- ...withConfigs.flat(),
145
- ];
137
+ return [
138
+ AuthenticationService,
139
+ {
140
+ provide: RxapAuthenticationService,
141
+ useExisting: AuthenticationService
142
+ },
143
+ ...withConfigs.flat()
144
+ ];
146
145
  }
147
146
  function withAuthConfig(config) {
148
- return {
149
- provide: AUTH_CONFIG,
150
- useValue: config,
151
- };
147
+ return {
148
+ provide: AUTH_CONFIG,
149
+ useValue: config
150
+ };
152
151
  }
153
-
154
- // region
155
- // endregion
156
-
157
- /**
158
- * Generated bundle index. Do not edit.
159
- */
160
-
161
152
  export { AuthenticationGuard, AuthenticationService, ProvideAuth, withAuthConfig };
162
- //# sourceMappingURL=rxap-oauth.mjs.map
153
+
154
+ //# sourceMappingURL=rxap-oauth.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"rxap-oauth.mjs","sources":["../../../../../packages/angular/oauth/src/lib/authentication.service.ts","../../../../../packages/angular/oauth/src/lib/authentication-guard.ts","../../../../../packages/angular/oauth/src/lib/provide-auth.ts","../../../../../packages/angular/oauth/src/index.ts","../../../../../packages/angular/oauth/src/rxap-oauth.ts"],"sourcesContent":["import { Injectable, inject } from '@angular/core';\nimport {\n AuthenticationAccessToken,\n AuthenticationEvent,\n AuthenticationEventType,\n IAuthenticationService,\n RXAP_AUTHENTICATION_ACCESS_TOKEN,\n RXAP_AUTHENTICATION_DEACTIVATED,\n} from '@rxap/authentication';\nimport { isDefined } from '@rxap/rxjs';\nimport {\n AUTH_CONFIG,\n AuthConfig,\n OAuthService,\n} from 'angular-oauth2-oidc';\nimport { JwksValidationHandler } from 'angular-oauth2-oidc-jwks';\nimport {\n BehaviorSubject,\n distinctUntilChanged,\n EMPTY,\n firstValueFrom,\n Observable,\n startWith,\n Subject,\n} from 'rxjs';\nimport { map } from 'rxjs/operators';\n\nconst JONE_DOE_JWT = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c';\n\n@Injectable()\nexport class AuthenticationService implements IAuthenticationService {\n private readonly oauthService = inject(OAuthService);\n private readonly authConfig = inject<AuthConfig>(AUTH_CONFIG, { optional: true });\n private readonly authenticationAccessToken = inject<BehaviorSubject<AuthenticationAccessToken | null>>(RXAP_AUTHENTICATION_ACCESS_TOKEN);\n private readonly isAuthDisabled = inject(RXAP_AUTHENTICATION_DEACTIVATED);\n\n events$: Observable<AuthenticationEvent> = EMPTY;\n public readonly isAuthenticated$ = new BehaviorSubject<boolean | null>(null);\n\n /**\n * Is only used when authentication is disabled to emit the events\n * @private\n */\n private readonly _events$ = new Subject<AuthenticationEvent>();\n\n constructor() {\n if (this.isAuthDisabled) {\n this.events$ = this._events$.asObservable();\n this.linkEventsAndIsAuthenticated();\n this._events$.next({\n type: AuthenticationEventType.OnAuthSuccess,\n payload: null,\n });\n this.authenticationAccessToken.next({\n token: JONE_DOE_JWT,\n valid: true,\n });\n } else {\n this.init();\n }\n }\n\n init() {\n if (this.authConfig) {\n this.oauthService.configure(this.authConfig);\n }\n this.events$ = this.oauthService.events.pipe(\n map(event => {\n switch (true) {\n case [ 'token_received', 'token_refreshed', 'silently_refreshed' ].includes(event.type):\n this.authenticationAccessToken.next({\n token: this.oauthService.getAccessToken(),\n valid: this.oauthService.hasValidAccessToken(),\n });\n return {\n type: AuthenticationEventType.OnAuthSuccess,\n payload: event,\n };\n case event.type.endsWith('_error') ||\n [ 'silent_refresh_timeout', 'invalid_nonce_in_state' ].includes(event.type):\n this.authenticationAccessToken.next(null);\n return {\n type: AuthenticationEventType.OnAuthError,\n payload: event,\n };\n case [ 'token_expires', 'logout', 'session_terminated' ].includes(event.type):\n this.authenticationAccessToken.next(null);\n return {\n type: AuthenticationEventType.OnLogout,\n payload: event,\n };\n default:\n console.warn('Unhandled event', event);\n return null;\n }\n }),\n isDefined(),\n );\n this.linkEventsAndIsAuthenticated();\n\n // Use setStorage to use sessionStorage or another implementation of the TS-type Storage\n // instead of localStorage\n this.oauthService.setStorage(sessionStorage);\n\n if (this.oauthService.silentRefreshRedirectUri) {\n this.oauthService.setupAutomaticSilentRefresh();\n }\n\n this.oauthService.tokenValidationHandler = new JwksValidationHandler();\n this.oauthService.loadDiscoveryDocumentAndTryLogin().then(status => {\n this.isAuthenticated$.next(status);\n });\n }\n\n async signOut(): Promise<void> {\n if (this.isAuthDisabled) {\n this._events$.next({\n type: AuthenticationEventType.OnLogout,\n payload: null,\n });\n } else {\n this.oauthService.logOut();\n }\n }\n\n signIn() {\n if (this.isAuthDisabled) {\n this._events$.next({\n type: AuthenticationEventType.OnAuthSuccess,\n payload: null,\n });\n } else {\n this.oauthService.initLoginFlow();\n }\n }\n\n private linkEventsAndIsAuthenticated() {\n this.events$.pipe(\n map(event => event ? event.type === AuthenticationEventType.OnAuthSuccess : null),\n distinctUntilChanged(),\n startWith(null),\n ).subscribe(this.isAuthenticated$);\n }\n\n isAuthenticated(): Promise<boolean> {\n return firstValueFrom(this.isAuthenticated$.pipe(isDefined()));\n }\n\n}\n","import { inject } from '@angular/core';\nimport {\n ActivatedRouteSnapshot,\n RouterStateSnapshot,\n} from '@angular/router';\nimport {\n RXAP_AUTHENTICATION_DEACTIVATED,\n RxapAuthenticationService,\n} from '@rxap/authentication';\nimport { AuthenticationService } from './authentication.service';\n\nexport async function AuthenticationGuard(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean> {\n\n const isAuthDisabled = inject(RXAP_AUTHENTICATION_DEACTIVATED, { optional: true }) ?? false;\n\n if (isAuthDisabled) {\n console.warn('Authentication is disabled!');\n return true;\n }\n\n const authService = inject(RxapAuthenticationService);\n\n if (!(authService instanceof AuthenticationService)) {\n throw new Error(\n 'The RxapAuthenticationService must be an instance of AuthenticationService. Ensure the ProvideAuth() function is used in the application config.');\n }\n\n if (await authService.isAuthenticated()) {\n return true;\n }\n\n authService.signIn();\n return false;\n\n}\n","import { Provider } from '@angular/core';\nimport { RxapAuthenticationService } from '@rxap/authentication';\nimport {\n AUTH_CONFIG,\n AuthConfig,\n} from 'angular-oauth2-oidc';\nimport { AuthenticationService } from './authentication.service';\n\nexport function ProvideAuth(...withConfigs: Array<Provider | Provider[]>): Provider[] {\n return [\n AuthenticationService,\n {\n provide: RxapAuthenticationService,\n useExisting: AuthenticationService,\n },\n ...withConfigs.flat(),\n ];\n}\n\nexport function withAuthConfig(config: AuthConfig): Provider {\n return {\n provide: AUTH_CONFIG,\n useValue: config,\n };\n}\n","// region \nexport * from './lib/authentication-guard';\nexport * from './lib/authentication.service';\nexport * from './lib/provide-auth';\n// endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AA2BA,MAAM,YAAY,GAAG,6JAA6J;MAGrK,qBAAqB,CAAA;AAehC,IAAA,WAAA,GAAA;AAdiB,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;QACnC,IAAA,CAAA,UAAU,GAAG,MAAM,CAAa,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAChE,QAAA,IAAA,CAAA,yBAAyB,GAAG,MAAM,CAAoD,gCAAgC,CAAC;AACvH,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,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AC,+BAA+B,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,IAAI,KAAK;IAE3F,IAAI,cAAc,EAAE;AAClB,QAAA,OAAO,CAAC,IAAI,CAAC,6BAA6B,CAAC;AAC3C,QAAA,OAAO,IAAI;IACb;AAEA,IAAA,MAAM,WAAW,GAAG,MAAM,CAAC,yBAAyB,CAAC;AAErD,IAAA,IAAI,EAAE,WAAW,YAAY,qBAAqB,CAAC,EAAE;AACnD,QAAA,MAAM,IAAI,KAAK,CACb,kJAAkJ,CAAC;IACvJ;AAEA,IAAA,IAAI,MAAM,WAAW,CAAC,eAAe,EAAE,EAAE;AACvC,QAAA,OAAO,IAAI;IACb;IAEA,WAAW,CAAC,MAAM,EAAE;AACpB,IAAA,OAAO,KAAK;AAEd;;AC1BM,SAAU,WAAW,CAAC,GAAG,WAAyC,EAAA;IACtE,OAAO;QACL,qBAAqB;AACrB,QAAA;AACE,YAAA,OAAO,EAAE,yBAAyB;AAClC,YAAA,WAAW,EAAE,qBAAqB;AACnC,SAAA;QACD,GAAG,WAAW,CAAC,IAAI,EAAE;KACtB;AACH;AAEM,SAAU,cAAc,CAAC,MAAkB,EAAA;IAC/C,OAAO;AACL,QAAA,OAAO,EAAE,WAAW;AACpB,QAAA,QAAQ,EAAE,MAAM;KACjB;AACH;;ACxBA;AAIA;;ACJA;;AAEG;;;;"}
1
+ {"version":3,"file":"rxap-oauth.mjs","names":[],"sources":["../../../../../packages/angular/oauth/src/lib/authentication.service.ts","../../../../../packages/angular/oauth/src/lib/authentication-guard.ts","../../../../../packages/angular/oauth/src/lib/provide-auth.ts"],"sourcesContent":["import { Injectable, inject } from '@angular/core';\nimport {\n AuthenticationAccessToken,\n AuthenticationEvent,\n AuthenticationEventType,\n IAuthenticationService,\n RXAP_AUTHENTICATION_ACCESS_TOKEN,\n RXAP_AUTHENTICATION_DEACTIVATED,\n} from '@rxap/authentication';\nimport { isDefined } from '@rxap/rxjs';\nimport {\n AUTH_CONFIG,\n AuthConfig,\n OAuthService,\n} from 'angular-oauth2-oidc';\nimport { JwksValidationHandler } from 'angular-oauth2-oidc-jwks';\nimport {\n BehaviorSubject,\n distinctUntilChanged,\n EMPTY,\n firstValueFrom,\n Observable,\n startWith,\n Subject,\n} from 'rxjs';\nimport { map } from 'rxjs/operators';\n\nconst JONE_DOE_JWT = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c';\n\n@Injectable()\nexport class AuthenticationService implements IAuthenticationService {\n private readonly oauthService = inject(OAuthService);\n private readonly authConfig = inject<AuthConfig>(AUTH_CONFIG, { optional: true });\n private readonly authenticationAccessToken = inject<BehaviorSubject<AuthenticationAccessToken | null>>(RXAP_AUTHENTICATION_ACCESS_TOKEN);\n private readonly isAuthDisabled = inject(RXAP_AUTHENTICATION_DEACTIVATED);\n\n events$: Observable<AuthenticationEvent> = EMPTY;\n public readonly isAuthenticated$ = new BehaviorSubject<boolean | null>(null);\n\n /**\n * Is only used when authentication is disabled to emit the events\n * @private\n */\n private readonly _events$ = new Subject<AuthenticationEvent>();\n\n constructor() {\n if (this.isAuthDisabled) {\n this.events$ = this._events$.asObservable();\n this.linkEventsAndIsAuthenticated();\n this._events$.next({\n type: AuthenticationEventType.OnAuthSuccess,\n payload: null,\n });\n this.authenticationAccessToken.next({\n token: JONE_DOE_JWT,\n valid: true,\n });\n } else {\n this.init();\n }\n }\n\n init() {\n if (this.authConfig) {\n this.oauthService.configure(this.authConfig);\n }\n this.events$ = this.oauthService.events.pipe(\n map(event => {\n switch (true) {\n case [ 'token_received', 'token_refreshed', 'silently_refreshed' ].includes(event.type):\n this.authenticationAccessToken.next({\n token: this.oauthService.getAccessToken(),\n valid: this.oauthService.hasValidAccessToken(),\n });\n return {\n type: AuthenticationEventType.OnAuthSuccess,\n payload: event,\n };\n case event.type.endsWith('_error') ||\n [ 'silent_refresh_timeout', 'invalid_nonce_in_state' ].includes(event.type):\n this.authenticationAccessToken.next(null);\n return {\n type: AuthenticationEventType.OnAuthError,\n payload: event,\n };\n case [ 'token_expires', 'logout', 'session_terminated' ].includes(event.type):\n this.authenticationAccessToken.next(null);\n return {\n type: AuthenticationEventType.OnLogout,\n payload: event,\n };\n default:\n console.warn('Unhandled event', event);\n return null;\n }\n }),\n isDefined(),\n );\n this.linkEventsAndIsAuthenticated();\n\n // Use setStorage to use sessionStorage or another implementation of the TS-type Storage\n // instead of localStorage\n this.oauthService.setStorage(sessionStorage);\n\n if (this.oauthService.silentRefreshRedirectUri) {\n this.oauthService.setupAutomaticSilentRefresh();\n }\n\n this.oauthService.tokenValidationHandler = new JwksValidationHandler();\n this.oauthService.loadDiscoveryDocumentAndTryLogin().then(status => {\n this.isAuthenticated$.next(status);\n });\n }\n\n async signOut(): Promise<void> {\n if (this.isAuthDisabled) {\n this._events$.next({\n type: AuthenticationEventType.OnLogout,\n payload: null,\n });\n } else {\n this.oauthService.logOut();\n }\n }\n\n signIn() {\n if (this.isAuthDisabled) {\n this._events$.next({\n type: AuthenticationEventType.OnAuthSuccess,\n payload: null,\n });\n } else {\n this.oauthService.initLoginFlow();\n }\n }\n\n private linkEventsAndIsAuthenticated() {\n this.events$.pipe(\n map(event => event ? event.type === AuthenticationEventType.OnAuthSuccess : null),\n distinctUntilChanged(),\n startWith(null),\n ).subscribe(this.isAuthenticated$);\n }\n\n isAuthenticated(): Promise<boolean> {\n return firstValueFrom(this.isAuthenticated$.pipe(isDefined()));\n }\n\n}\n","import { inject } from '@angular/core';\nimport {\n ActivatedRouteSnapshot,\n RouterStateSnapshot,\n} from '@angular/router';\nimport {\n RXAP_AUTHENTICATION_DEACTIVATED,\n RxapAuthenticationService,\n} from '@rxap/authentication';\nimport { AuthenticationService } from './authentication.service';\n\nexport async function AuthenticationGuard(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean> {\n\n const isAuthDisabled = inject(RXAP_AUTHENTICATION_DEACTIVATED, { optional: true }) ?? false;\n\n if (isAuthDisabled) {\n console.warn('Authentication is disabled!');\n return true;\n }\n\n const authService = inject(RxapAuthenticationService);\n\n if (!(authService instanceof AuthenticationService)) {\n throw new Error(\n 'The RxapAuthenticationService must be an instance of AuthenticationService. Ensure the ProvideAuth() function is used in the application config.');\n }\n\n if (await authService.isAuthenticated()) {\n return true;\n }\n\n authService.signIn();\n return false;\n\n}\n","import { Provider } from '@angular/core';\nimport { RxapAuthenticationService } from '@rxap/authentication';\nimport {\n AUTH_CONFIG,\n AuthConfig,\n} from 'angular-oauth2-oidc';\nimport { AuthenticationService } from './authentication.service';\n\nexport function ProvideAuth(...withConfigs: Array<Provider | Provider[]>): Provider[] {\n return [\n AuthenticationService,\n {\n provide: RxapAuthenticationService,\n useExisting: AuthenticationService,\n },\n ...withConfigs.flat(),\n ];\n}\n\nexport function withAuthConfig(config: AuthConfig): Provider {\n return {\n provide: AUTH_CONFIG,\n useValue: config,\n };\n}\n"],"mappings":";;;;;;;;AA2BA,MAAM,eAAe;AAGrB,IAAa,wBAAb,MAAa,sBAAqB;CAehC,cAAA;EAdiB,KAAA,eAAe,OAAO,YAAY;EAClC,KAAA,aAAa,OAAmB,aAAa,EAAE,UAAU,KAAI,CAAE;EAC/D,KAAA,4BAA4B,OAA0D,gCAAgC;EACtH,KAAA,iBAAiB,OAAO,+BAA+B;EAExE,KAAA,UAA2C;EAC3B,KAAA,mBAAmB,IAAI,gBAAgC,IAAI;EAM1D,KAAA,WAAW,IAAI,QAAO;EAGrC,IAAI,KAAK,gBAAgB;GACvB,KAAK,UAAU,KAAK,SAAS,aAAY;GACzC,KAAK,6BAA4B;GACjC,KAAK,SAAS,KAAK;IACjB,MAAM,wBAAwB;IAC9B,SAAS;GACV,CAAA;GACD,KAAK,0BAA0B,KAAK;IAClC,OAAO;IACP,OAAO;GACR,CAAA;EACH,OACE,KAAK,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
+ "version": "22.0.0-dev.0",
3
3
  "name": "@rxap/oauth",
4
4
  "description": "This package provides an authentication guard and service for Angular applications using OAuth 2.0 and OpenID Connect. It simplifies the integration of authentication flows, including sign-in, sign-out, and token management, with support for disabled authentication scenarios. The package also includes a provider function to streamline configuration.\n",
5
5
  "license": "GPL-3.0-or-later",
6
6
  "dependencies": {
7
- "@nx/devkit": "22.7.5",
7
+ "@nx/devkit": "24.0.6",
8
8
  "tslib": "2.6.2"
9
9
  },
10
10
  "peerDependencies": {
11
- "@angular/core": "^21.2.9",
12
- "@angular/router": "^21.2.9",
13
- "@rxap/authentication": "^21.0.1",
11
+ "@angular/core": "^22.3.0",
12
+ "@angular/router": "^22.3.0",
13
+ "@rxap/authentication": "^22.0.0-dev.0",
14
14
  "@rxap/rxjs": "^1.1.18",
15
15
  "angular-oauth2-oidc": "^15.0.1",
16
16
  "angular-oauth2-oidc-jwks": "^15.0.1",
@@ -39,27 +39,27 @@
39
39
  "packageGroup": [
40
40
  {
41
41
  "package": "@angular/common",
42
- "version": "21.2.9"
42
+ "version": "22.3.0"
43
43
  },
44
44
  {
45
45
  "package": "@angular/compiler",
46
- "version": "21.2.9"
46
+ "version": "22.3.0"
47
47
  },
48
48
  {
49
49
  "package": "@angular/core",
50
- "version": "21.2.9"
50
+ "version": "22.3.0"
51
51
  },
52
52
  {
53
53
  "package": "@angular/platform-browser",
54
- "version": "21.2.9"
54
+ "version": "22.3.0"
55
55
  },
56
56
  {
57
57
  "package": "@angular/router",
58
- "version": "21.2.9"
58
+ "version": "22.3.0"
59
59
  },
60
60
  {
61
61
  "package": "@rxap/authentication",
62
- "version": "21.0.1"
62
+ "version": "22.0.0-dev.0"
63
63
  },
64
64
  {
65
65
  "package": "@rxap/rxjs",
@@ -1,35 +1,33 @@
1
- import { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
2
- import { IAuthenticationService, AuthenticationEvent } from '@rxap/authentication';
3
- import { Observable, BehaviorSubject } from 'rxjs';
4
- import * as i0 from '@angular/core';
5
- import { Provider } from '@angular/core';
6
- import { AuthConfig } from 'angular-oauth2-oidc';
7
-
8
- declare function AuthenticationGuard(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean>;
9
-
10
- declare class AuthenticationService implements IAuthenticationService {
11
- private readonly oauthService;
12
- private readonly authConfig;
13
- private readonly authenticationAccessToken;
14
- private readonly isAuthDisabled;
15
- events$: Observable<AuthenticationEvent>;
16
- readonly isAuthenticated$: BehaviorSubject<boolean | null>;
17
- /**
18
- * Is only used when authentication is disabled to emit the events
19
- * @private
20
- */
21
- private readonly _events$;
22
- constructor();
23
- init(): void;
24
- signOut(): Promise<void>;
25
- signIn(): void;
26
- private linkEventsAndIsAuthenticated;
27
- isAuthenticated(): Promise<boolean>;
28
- static ɵfac: i0.ɵɵFactoryDeclaration<AuthenticationService, never>;
29
- static ɵprov: i0.ɵɵInjectableDeclaration<AuthenticationService>;
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ import { ActivatedRouteSnapshot, RouterStateSnapshot } from "@angular/router";
5
+ import { AuthenticationEvent, IAuthenticationService } from "@rxap/authentication";
6
+ import { BehaviorSubject, Observable } from "rxjs";
7
+ import * as i0 from "@angular/core";
8
+ import { Provider } from "@angular/core";
9
+ import { AuthConfig } from "angular-oauth2-oidc";
10
+ export declare function AuthenticationGuard(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean>;
11
+ export declare class AuthenticationService implements IAuthenticationService {
12
+ private readonly oauthService;
13
+ private readonly authConfig;
14
+ private readonly authenticationAccessToken;
15
+ private readonly isAuthDisabled;
16
+ events$: Observable<AuthenticationEvent>;
17
+ readonly isAuthenticated$: BehaviorSubject<boolean | null>;
18
+ /**
19
+ * Is only used when authentication is disabled to emit the events
20
+ * @private
21
+ */
22
+ private readonly _events$;
23
+ constructor();
24
+ init(): void;
25
+ signOut(): Promise<void>;
26
+ signIn(): void;
27
+ private linkEventsAndIsAuthenticated;
28
+ isAuthenticated(): Promise<boolean>;
29
+ static ɵfac: i0.ɵɵFactoryDeclaration<AuthenticationService, never>;
30
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
30
31
  }
31
-
32
- declare function ProvideAuth(...withConfigs: Array<Provider | Provider[]>): Provider[];
33
- declare function withAuthConfig(config: AuthConfig): Provider;
34
-
35
- export { AuthenticationGuard, AuthenticationService, ProvideAuth, withAuthConfig };
32
+ export declare function ProvideAuth(...withConfigs: Array<Provider | Provider[]>): Provider[];
33
+ export declare function withAuthConfig(config: AuthConfig): Provider;