@huntsman-cancer-institute/authentication 15.0.3 → 16.0.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.
@@ -1,1000 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { InjectionToken, Injectable, Inject, isDevMode, Optional, Component, ViewChild, NgModule, SkipSelf } from '@angular/core';
3
- import * as i4$1 from '@angular/common';
4
- import { LocationStrategy, CommonModule } from '@angular/common';
5
- import * as i2$2 from '@angular/forms';
6
- import { Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
7
- import * as i1$1 from '@angular/common/http';
8
- import { HttpHeaders, HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
9
- import * as i2 from '@angular/router';
10
- import { RouterModule } from '@angular/router';
11
- import * as i1 from '@angular-cool/storage';
12
- import { CoolStorageModule } from '@angular-cool/storage';
13
- import * as i4 from '@auth0/angular-jwt';
14
- import { JwtHelperService, JwtInterceptor, JWT_OPTIONS } from '@auth0/angular-jwt';
15
- import { BehaviorSubject, interval, throwError, timer } from 'rxjs';
16
- import { map, catchError, first, takeWhile } from 'rxjs/operators';
17
- import * as i2$1 from '@angular/platform-browser';
18
- import { trigger, state, style, transition, animate } from '@angular/animations';
19
-
20
- let AUTHENTICATION_TOKEN_KEY = new InjectionToken("authentication_token_key");
21
- class AuthenticationProvider {
22
- constructor(_localStorageService, _authenticationTokenKey) {
23
- this._localStorageService = _localStorageService;
24
- this._authenticationTokenKey = _authenticationTokenKey;
25
- this.whitelistedDomains = [
26
- "localhost",
27
- new RegExp(".*[.]utah[.]edu")
28
- ];
29
- this.tokenGetter = () => {
30
- return this.authToken;
31
- };
32
- }
33
- get authenticationTokenKey() {
34
- return this._authenticationTokenKey;
35
- }
36
- set authenticationTokenKey(_authenticationTokenKey) {
37
- this._authenticationTokenKey = _authenticationTokenKey;
38
- }
39
- get authToken() {
40
- return this._localStorageService.getItem(this._authenticationTokenKey);
41
- }
42
- }
43
- AuthenticationProvider.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthenticationProvider, deps: [{ token: i1.CoolLocalStorage }, { token: AUTHENTICATION_TOKEN_KEY }], target: i0.ɵɵFactoryTarget.Injectable });
44
- AuthenticationProvider.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthenticationProvider });
45
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthenticationProvider, decorators: [{
46
- type: Injectable
47
- }], ctorParameters: function () {
48
- return [{ type: i1.CoolLocalStorage }, { type: undefined, decorators: [{
49
- type: Inject,
50
- args: [AUTHENTICATION_TOKEN_KEY]
51
- }] }];
52
- } });
53
-
54
- /*
55
- * Copyright (c) 2016 Huntsman Cancer Institute at the University of Utah, Confidential and Proprietary
56
- */
57
- /**
58
- * The token used for injection of the server side endpoint for the currently authenticated subject.
59
- *
60
- * @type {InjectionToken}
61
- */
62
- let AUTHENTICATION_SERVER_URL = new InjectionToken("authentication_server_rest_api");
63
- let AUTHENTICATION_LOGOUT_PATH = new InjectionToken("authentication_logout_path");
64
- let AUTHENTICATION_DIRECT_ENDPOINT = new InjectionToken("authentication_direct_endpoint");
65
- let AUTHENTICATION_TOKEN_ENDPOINT = new InjectionToken("authentication_token_endpoint");
66
- let AUTHENTICATION_ROUTE = new InjectionToken("authentication_route");
67
- let AUTHENTICATION_MAX_INACTIVITY_MINUTES = new InjectionToken("authentication_max_inactivity");
68
- let AUTHENTICATION_USER_COUNTDOWN_SECONDS = new InjectionToken("authentication_user_countdown_seconds");
69
- let AUTHENTICATION_IDP_INACTIVITY_MINUTES = new InjectionToken("authentication_idp_inactivity_minutes");
70
- /**
71
- * @since 1.0.0
72
- */
73
- class AuthenticationService {
74
- constructor(_http, _router, _localStorageService, _jwtHelper, authenticationProvider, _authenticationRoute, _logoutPath, _tokenEndpoint, _serverUrl, _directEndpoint, _maxInactivity, _userCountdownSeconds, _idpInactivityMinutes, locationStrategy) {
75
- this._http = _http;
76
- this._router = _router;
77
- this._localStorageService = _localStorageService;
78
- this._jwtHelper = _jwtHelper;
79
- this.authenticationProvider = authenticationProvider;
80
- this._authenticationRoute = _authenticationRoute;
81
- this._logoutPath = _logoutPath;
82
- this._tokenEndpoint = _tokenEndpoint;
83
- this._serverUrl = _serverUrl;
84
- this._directEndpoint = _directEndpoint;
85
- this._maxInactivity = _maxInactivity;
86
- this._userCountdownSeconds = _userCountdownSeconds;
87
- this._idpInactivityMinutes = _idpInactivityMinutes;
88
- this.locationStrategy = locationStrategy;
89
- this.userCountdownSeconds = 60;
90
- this.idpInactivityMinutes = 5;
91
- this.contentType = "application/json";
92
- this.limitedContext = false;
93
- this.deidentifiedContext = false;
94
- this.maxViewPermission = new BehaviorSubject("viewident");
95
- this._isAuthenticatedSubject = new BehaviorSubject(false);
96
- this._userIsAboutToTimeOut = new BehaviorSubject(false);
97
- this._maxInactivityMinutes = 120;
98
- this.contextRoot = "";
99
- if (isDevMode()) {
100
- console.debug("window.location.href: " + window.location.href);
101
- }
102
- if (window.location) {
103
- let parts = window.location.href.split("/");
104
- this.baseUrl = parts[0] + "//" + parts[2];
105
- if (parts.length > 3) {
106
- this.contextRoot = parts[3];
107
- }
108
- }
109
- if (this._localStorageService.getItem("maxViewPermission")) {
110
- this.maxViewPermission.next(this._localStorageService.getItem("maxViewPermission"));
111
- }
112
- if (_maxInactivity) {
113
- this._maxInactivityMinutes = _maxInactivity;
114
- }
115
- if (_userCountdownSeconds) {
116
- this.userCountdownSeconds = _userCountdownSeconds;
117
- }
118
- if (_idpInactivityMinutes) {
119
- this.idpInactivityMinutes = _idpInactivityMinutes;
120
- }
121
- this.hasValidConfig();
122
- //There could be a non-expired token in local storage.
123
- let token = this.authenticationProvider.authToken;
124
- this.storeToken(token);
125
- }
126
- getBaseUrl() {
127
- return (this.baseUrl) ? this.baseUrl : "";
128
- }
129
- getContextRoot() {
130
- return this.contextRoot;
131
- }
132
- getHeaders(req) {
133
- let headers = req.headers;
134
- //Don't set content type if already set
135
- if (!req.headers.get(AuthenticationService.CONTENT_TYPE)) {
136
- headers = headers.set(AuthenticationService.CONTENT_TYPE, this.contentType.toString());
137
- }
138
- if (headers.get(AuthenticationService.SEC_GOV_CLASS_HEADER) === "") {
139
- headers = headers.delete(AuthenticationService.SEC_GOV_CLASS_HEADER);
140
- }
141
- else if (this.securityGovernorClass && !headers.get(AuthenticationService.SEC_GOV_CLASS_HEADER)) {
142
- headers = headers.set(AuthenticationService.SEC_GOV_CLASS_HEADER, this.securityGovernorClass);
143
- }
144
- if (headers.get(AuthenticationService.SEC_GOV_ID_HEADER) === "") {
145
- headers = headers.delete(AuthenticationService.SEC_GOV_ID_HEADER);
146
- }
147
- else if (this.securityGovernorId && !headers.get(AuthenticationService.SEC_GOV_ID_HEADER)) {
148
- headers = headers.set(AuthenticationService.SEC_GOV_ID_HEADER, this.securityGovernorId.toString());
149
- }
150
- headers = headers.set(AuthenticationService.DEIDENT_HEADER, this.deidentifiedContext.toString());
151
- headers = headers.set(AuthenticationService.LIMITED_HEADER, this.limitedContext.toString());
152
- return headers;
153
- }
154
- get authenticationTokenKey() {
155
- return this.authenticationProvider.authenticationTokenKey;
156
- }
157
- get authToken() {
158
- return this.authenticationProvider.authToken;
159
- }
160
- updateUserActivity() {
161
- if (this._isAuthenticatedSubject.value) {
162
- this._lastUserInteraction = new Date();
163
- this._userIsAboutToTimeOut.next(false);
164
- }
165
- }
166
- /**
167
- * A mutator for identifying the clients original request location. Setting this value will influence the end location
168
- * navigated to by {@link #navigateToPath}.
169
- *
170
- * @param redirectUrl location of the users request before authentication
171
- */
172
- set redirectUrl(redirectUrl) {
173
- this._redirectUrl = redirectUrl;
174
- }
175
- get redirectUrl() {
176
- return this._redirectUrl;
177
- }
178
- requestAccessToken(redirectOnSuccess) {
179
- this._http.get(this.tokenLocation(), { withCredentials: true })
180
- .subscribe((response) => {
181
- this.storeToken(response.auth_token);
182
- if (redirectOnSuccess) {
183
- this.proceedIfAuthenticated();
184
- }
185
- }, (error) => {
186
- //Token refresh failed.
187
- this.logout(true);
188
- });
189
- }
190
- /**
191
- * Verifies whether or not a current user session exists.
192
- *
193
- * @returns {Observable<boolean>} evaluates to true if the user is authenticated, false otherwise.
194
- */
195
- isAuthenticated() {
196
- return this._isAuthenticatedSubject.asObservable();
197
- }
198
- isAboutToTimeOut() {
199
- return this._userIsAboutToTimeOut.asObservable();
200
- }
201
- getTimeoutStart() {
202
- if (this._lastUserInteraction) {
203
- return this._lastUserInteraction.valueOf() + (((this._maxInactivityMinutes * 60) - this.userCountdownSeconds) * 1000);
204
- }
205
- }
206
- tokenLocation() {
207
- if (this._serverUrl) {
208
- return this._serverUrl + this._tokenEndpoint;
209
- }
210
- else {
211
- return this._tokenEndpoint;
212
- }
213
- }
214
- directLoginLocation() {
215
- if (this._serverUrl) {
216
- return this._serverUrl + this._directEndpoint;
217
- }
218
- else {
219
- return this._directEndpoint;
220
- }
221
- }
222
- logoutLocation() {
223
- if (this._serverUrl) {
224
- return this._serverUrl + this._logoutPath;
225
- }
226
- else {
227
- return this._logoutPath;
228
- }
229
- }
230
- /**
231
- * A function to authenticated the user with the provided credentials. Failure results in an error that describes the
232
- * server response (status and status message) and should be actionable by the client application.
233
- *
234
- * @param username of the authenticating user to verify
235
- * @param password of the authenticating user to verify
236
- * @returns {Observable<R>} describing the result of the login action, true or an error
237
- */
238
- login(_username, _password) {
239
- return this._http.post(this.directLoginLocation(), { username: _username, password: _password }, { observe: "response" }).pipe(map((resp) => {
240
- if (resp.status === 201) {
241
- return true;
242
- }
243
- else {
244
- throw new Error("Authentication failed. " + resp.status + ": " + resp.statusText);
245
- }
246
- }), catchError(this.handleError));
247
- }
248
- clearLogin() {
249
- //Front-end logout
250
- try {
251
- this._localStorageService.removeItem(this.authenticationProvider.authenticationTokenKey);
252
- this.unsubscribeFromTokenRefresh();
253
- this._isAuthenticatedSubject.next(false);
254
- this._userIsAboutToTimeOut.next(false);
255
- }
256
- catch (Error) {
257
- }
258
- //Back-end logout
259
- let headers = new HttpHeaders().set(AuthenticationService.CONTENT_TYPE, "text/plain");
260
- return this._http.get(this.logoutLocation(), { headers: headers });
261
- }
262
- /**
263
- * A function to signal the termination of the current session. Invoking this function will clean up any relevant state
264
- * related to the last active session.
265
- */
266
- logout(keepCurrentRoute = false) {
267
- //Prevent logout if already on authentication route. Doing otherwise screws up SAML
268
- if (!this._router.routerState || this._router.routerState.snapshot.url !== this._authenticationRoute) {
269
- this._redirectUrl = (keepCurrentRoute && this._router.routerState && this._router.routerState.snapshot) ? this._router.routerState.snapshot.url : "";
270
- if (this._redirectUrl.startsWith("/")) {
271
- this._redirectUrl = this._redirectUrl.substring(1);
272
- }
273
- this.clearLogin().subscribe((response) => {
274
- window.location.replace(this._redirectUrl);
275
- }, (error) => {
276
- window.location.replace(this._redirectUrl);
277
- });
278
- }
279
- }
280
- storeToken(token) {
281
- let valid = this.validateToken(token);
282
- // unsubscribe from refesh before we decide wether to resubscribe
283
- this.unsubscribeFromTokenRefresh();
284
- if (valid) {
285
- this._localStorageService.setItem(this.authenticationProvider.authenticationTokenKey, token);
286
- this.subscribeToTokenRefresh(token);
287
- //Change the BehaviorSubject if the user was not previously authenticated.
288
- //Since other code may be subscribing to this observable, we don't want to cause new events to fire if just refreshing the JWT.
289
- if (!this._isAuthenticatedSubject.value) {
290
- this._isAuthenticatedSubject.next(true);
291
- }
292
- }
293
- else {
294
- this._localStorageService.removeItem(this.authenticationProvider.authenticationTokenKey);
295
- this._isAuthenticatedSubject.next(false);
296
- }
297
- }
298
- proceedIfAuthenticated() {
299
- if (isDevMode()) {
300
- console.debug("AuthenticationService.proceedIfAuthenticated: " + this._redirectUrl);
301
- }
302
- if (this._isAuthenticatedSubject.value) {
303
- //Login counts as user activity, too
304
- this.updateUserActivity();
305
- if (this._redirectUrl && this._redirectUrl && this._redirectUrl !== "") {
306
- this._router.navigateByUrl(this._redirectUrl);
307
- }
308
- else {
309
- this._router.navigate([""]);
310
- }
311
- return true;
312
- }
313
- else {
314
- return false;
315
- }
316
- }
317
- validateToken(token) {
318
- return (token && !this._jwtHelper.isTokenExpired(token));
319
- }
320
- subscribeToTokenRefresh(token) {
321
- let exp = this._jwtHelper.getTokenExpirationDate(token);
322
- // Use a timer to periodically check timeouts
323
- this._refreshSubscription = interval(1000)
324
- .subscribe(() => {
325
- // If a tab is inactive we can't know if our timer is accurate
326
- // so when the interval hits check against timestamps
327
- if (this._isAuthenticatedSubject.value && Date.now() > this.getTimeoutStart()) {
328
- //Don't update the subject more than once! Doing so initializes more than one countdown timer!
329
- if (this._userIsAboutToTimeOut.getValue() !== true) {
330
- this._userIsAboutToTimeOut.next(true);
331
- }
332
- }
333
- // check for refresh token
334
- let msToExpiry = (exp.valueOf() - new Date().valueOf());
335
- // Refresh 60 seconds before expiry
336
- if (msToExpiry <= 60000) {
337
- this.refreshTokenIfUserIsActive();
338
- }
339
- });
340
- }
341
- unsubscribeFromTokenRefresh() {
342
- if (this._refreshSubscription && !this._refreshSubscription.closed) {
343
- this._refreshSubscription.unsubscribe();
344
- }
345
- }
346
- getMaxViewPermission() {
347
- return this.maxViewPermission.getValue();
348
- }
349
- getMaxViewPermissionSubject() {
350
- return this.maxViewPermission;
351
- }
352
- setMaxViewPermission(maxViewPermission) {
353
- this._localStorageService.setItem("maxViewPermission", maxViewPermission);
354
- this.maxViewPermission.next(maxViewPermission);
355
- }
356
- refreshTokenIfUserIsActive() {
357
- //Only refresh if the user has been active
358
- if (this._lastUserInteraction && ((new Date().valueOf() - this._lastUserInteraction.valueOf()) <= (this._maxInactivityMinutes * 60 * 1000))) {
359
- this.requestAccessToken(false);
360
- }
361
- }
362
- hasValidConfig() {
363
- if (this._tokenEndpoint == null && (this._serverUrl === null || this._logoutPath === null)) {
364
- throw new Error("BUG ALERT! Invalid AuthenticationService configuration. No valid configuration for authentication endpoint(s).");
365
- }
366
- if (this._localStorageService === null || this.authenticationProvider.authenticationTokenKey === null) {
367
- throw new Error("BUG ALERT! Invalid AuthenticationService configuration. No valid configuration for local storage");
368
- }
369
- }
370
- handleError(error) {
371
- let errMsg = (error.message) ? error.message : AuthenticationService.GENERIC_ERR_MSG;
372
- return throwError(errMsg);
373
- }
374
- }
375
- /**
376
- * The generic error message used when a server error is thrown without a status.
377
- *
378
- * @type {string}
379
- */
380
- AuthenticationService.GENERIC_ERR_MSG = "Server error";
381
- AuthenticationService.CONTENT_TYPE = "Content-Type";
382
- AuthenticationService.SEC_GOV_CLASS_HEADER = "SecurityGovernorClass";
383
- AuthenticationService.SEC_GOV_ID_HEADER = "SecurityGovernorId";
384
- AuthenticationService.DEIDENT_HEADER = "DeidentifiedContext";
385
- AuthenticationService.LIMITED_HEADER = "LimitedContext";
386
- AuthenticationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthenticationService, deps: [{ token: i1$1.HttpClient }, { token: i2.Router }, { token: i1.CoolLocalStorage }, { token: i4.JwtHelperService }, { token: AuthenticationProvider }, { token: AUTHENTICATION_ROUTE }, { token: AUTHENTICATION_LOGOUT_PATH }, { token: AUTHENTICATION_TOKEN_ENDPOINT }, { token: AUTHENTICATION_SERVER_URL, optional: true }, { token: AUTHENTICATION_DIRECT_ENDPOINT, optional: true }, { token: AUTHENTICATION_MAX_INACTIVITY_MINUTES, optional: true }, { token: AUTHENTICATION_USER_COUNTDOWN_SECONDS, optional: true }, { token: AUTHENTICATION_IDP_INACTIVITY_MINUTES, optional: true }, { token: LocationStrategy, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
387
- AuthenticationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthenticationService });
388
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthenticationService, decorators: [{
389
- type: Injectable
390
- }], ctorParameters: function () {
391
- return [{ type: i1$1.HttpClient }, { type: i2.Router }, { type: i1.CoolLocalStorage }, { type: i4.JwtHelperService }, { type: AuthenticationProvider }, { type: undefined, decorators: [{
392
- type: Inject,
393
- args: [AUTHENTICATION_ROUTE]
394
- }] }, { type: undefined, decorators: [{
395
- type: Inject,
396
- args: [AUTHENTICATION_LOGOUT_PATH]
397
- }] }, { type: undefined, decorators: [{
398
- type: Inject,
399
- args: [AUTHENTICATION_TOKEN_ENDPOINT]
400
- }] }, { type: undefined, decorators: [{
401
- type: Optional
402
- }, {
403
- type: Inject,
404
- args: [AUTHENTICATION_SERVER_URL]
405
- }] }, { type: undefined, decorators: [{
406
- type: Optional
407
- }, {
408
- type: Inject,
409
- args: [AUTHENTICATION_DIRECT_ENDPOINT]
410
- }] }, { type: undefined, decorators: [{
411
- type: Optional
412
- }, {
413
- type: Inject,
414
- args: [AUTHENTICATION_MAX_INACTIVITY_MINUTES]
415
- }] }, { type: undefined, decorators: [{
416
- type: Optional
417
- }, {
418
- type: Inject,
419
- args: [AUTHENTICATION_USER_COUNTDOWN_SECONDS]
420
- }] }, { type: undefined, decorators: [{
421
- type: Optional
422
- }, {
423
- type: Inject,
424
- args: [AUTHENTICATION_IDP_INACTIVITY_MINUTES]
425
- }] }, { type: i4$1.LocationStrategy, decorators: [{
426
- type: Optional
427
- }, {
428
- type: Inject,
429
- args: [LocationStrategy]
430
- }] }];
431
- } });
432
-
433
- /*
434
- * Copyright (c) 2016 Huntsman Cancer Institute at the University of Utah, Confidential and Proprietary
435
- */
436
- /**
437
- * A {@code CanActivate} implementation which makes its calculation based on the current authentication state.
438
- *
439
- * @since 1.0.0
440
- */
441
- class RouteGuardService {
442
- constructor(_authenticationService, _router, _authenticationRoute) {
443
- this._authenticationService = _authenticationService;
444
- this._router = _router;
445
- this._authenticationRoute = _authenticationRoute;
446
- }
447
- /**
448
- * Determines whether or not a route can be activated, based on the current authentication state.
449
- *
450
- * @param route for activation to be determined on
451
- * @param state of the router snapshot
452
- * @returns {Observable<boolean>} describing the result of this calculation
453
- */
454
- canActivate(route, state) {
455
- return this._authenticationService.isAuthenticated().pipe(map((authenticated) => {
456
- if (!authenticated) {
457
- // Store the attempted URL for redirecting
458
- this._authenticationService.redirectUrl = state.url;
459
- // Navigate to the login page
460
- this._router.navigate([this._authenticationRoute]);
461
- }
462
- return authenticated;
463
- }, (error) => {
464
- return false;
465
- }));
466
- }
467
- ;
468
- }
469
- RouteGuardService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RouteGuardService, deps: [{ token: AuthenticationService }, { token: i2.Router }, { token: AUTHENTICATION_ROUTE }], target: i0.ɵɵFactoryTarget.Injectable });
470
- RouteGuardService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RouteGuardService });
471
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RouteGuardService, decorators: [{
472
- type: Injectable
473
- }], ctorParameters: function () {
474
- return [{ type: AuthenticationService }, { type: i2.Router }, { type: undefined, decorators: [{
475
- type: Inject,
476
- args: [AUTHENTICATION_ROUTE]
477
- }] }];
478
- } });
479
-
480
- /*
481
- * Copyright (c) 2016 Huntsman Cancer Institute at the University of Utah, Confidential and Proprietary
482
- */
483
- class AuthenticationComponent {
484
- constructor(authenticationService, domSanitizer, router, location, renderer, authenticationRoute) {
485
- this.authenticationService = authenticationService;
486
- this.domSanitizer = domSanitizer;
487
- this.router = router;
488
- this.location = location;
489
- this.renderer = renderer;
490
- this.authenticationRoute = authenticationRoute;
491
- }
492
- ngOnInit() {
493
- /*
494
- * Fix back bug
495
- * Issue is that the browser will go back to the previous route. If it's guarded, the route guard will just load the login again
496
- * Eventually the browser gets to the /authenticate route and going back from there loads the iframe history and Shibboleth displays
497
- * an error relating to navigating back.
498
- */
499
- history.pushState(null, null, this.location.prepareExternalUrl(this.authenticationRoute));
500
- this.popstateSubscription = this.location.subscribe((value) => {
501
- //This is going to prevent back from working from the login component
502
- history.go(1);
503
- });
504
- this.beginAuthenticationProcess();
505
- }
506
- handleChanges() {
507
- if (!this.iframe.nativeElement.contentDocument) {
508
- return;
509
- }
510
- try {
511
- let element = this.iframe.nativeElement.contentDocument.body;
512
- if (element.querySelector("pre")) {
513
- element = element.querySelector("pre");
514
- }
515
- this._errorMsg = null;
516
- var jsonText = element.innerText;
517
- var json = JSON.parse(jsonText);
518
- this.authenticationService.storeToken(json.auth_token);
519
- var authenticated = this.authenticationService.proceedIfAuthenticated();
520
- if (!authenticated) {
521
- this.resetSubscription.unsubscribe();
522
- this.beginAuthenticationProcess();
523
- }
524
- }
525
- catch (error) {
526
- if (this.iframe.nativeElement.contentDocument.title.toUpperCase() === "ERROR") {
527
- if (this.iframe.nativeElement.contentDocument.body.innerHTML.toUpperCase() === "FORBIDDEN") {
528
- this._errorMsg = "You do not have permission to log into this application";
529
- }
530
- else {
531
- this._errorMsg = null;
532
- }
533
- //A bit of a workaround for a WildFly issue. Success on Pac4j authentication, but failure on DB load of user put things in a weird state. Just logout, and redo the login.
534
- this.clearLoginAndRetry();
535
- }
536
- }
537
- // After the iframe loads, make the background transparent so we use the implementation's background and not the sso background.
538
- this.renderer.setStyle(this.iframe.nativeElement.contentDocument.body, "background-color", "transparent");
539
- }
540
- ngOnDestroy() {
541
- this.resetSubscription.unsubscribe();
542
- this.popstateSubscription.unsubscribe();
543
- }
544
- clearLoginAndRetry() {
545
- this.resetSubscription.unsubscribe();
546
- this.authenticationService.clearLogin().subscribe(() => { this.beginAuthenticationProcess(); }, (error) => { this.beginAuthenticationProcess(); });
547
- }
548
- beginAuthenticationProcess() {
549
- var tokenEndpoint = this.authenticationService.tokenLocation();
550
- if (tokenEndpoint !== "") {
551
- this.url = this.domSanitizer.bypassSecurityTrustResourceUrl(tokenEndpoint);
552
- }
553
- /**
554
- * If the user doesn't complete authentication before the IdP session times out, that will be a problem when they eventually
555
- * attampt to log in. It is likely that users will do this often when they log out or are timed out in the evening, leave
556
- * their browser open, then attempt to log back in in the morning. In order to work around this, this component will re-request
557
- * the token prior to IdP timeout, which will reset the process. This will happen 1 minute before idpInactivityMinutes
558
- **/
559
- this.resetSubscription = interval((this.authenticationService.idpInactivityMinutes - 1) * 60 * 1000)
560
- .pipe(first())
561
- .subscribe((value) => {
562
- this.beginAuthenticationProcess();
563
- });
564
- }
565
- }
566
- AuthenticationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthenticationComponent, deps: [{ token: AuthenticationService }, { token: i2$1.DomSanitizer }, { token: i2.Router }, { token: i4$1.Location }, { token: i0.Renderer2 }, { token: AUTHENTICATION_ROUTE }], target: i0.ɵɵFactoryTarget.Component });
567
- AuthenticationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: AuthenticationComponent, selector: "authentication-iframe", host: { classAttribute: "outlet-row" }, viewQueries: [{ propertyName: "iframe", first: true, predicate: ["iframe"], descendants: true, static: true }], ngImport: i0, template: `
568
- <div class="container">
569
- <iframe #iframe class="frame" [src]="url" (load)="handleChanges()"></iframe>
570
- <div *ngIf="_errorMsg" class="alert-box">
571
- <div class="alert alert-danger">
572
- <h5 class="alert-heading">Authentication Failed</h5>
573
- <span id="hci-login-error" class="alert-text">{{_errorMsg}}</span>
574
- </div>
575
- </div>
576
- </div>
577
- `, isInline: true, styles: [":host{background-color:#fff}.container{max-width:100%;margin-top:60px;padding-top:15px}.frame{width:100%;height:100%;border:0px}\n"], dependencies: [{ kind: "directive", type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
578
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthenticationComponent, decorators: [{
579
- type: Component,
580
- args: [{ selector: "authentication-iframe", template: `
581
- <div class="container">
582
- <iframe #iframe class="frame" [src]="url" (load)="handleChanges()"></iframe>
583
- <div *ngIf="_errorMsg" class="alert-box">
584
- <div class="alert alert-danger">
585
- <h5 class="alert-heading">Authentication Failed</h5>
586
- <span id="hci-login-error" class="alert-text">{{_errorMsg}}</span>
587
- </div>
588
- </div>
589
- </div>
590
- `, host: { class: "outlet-row" }, styles: [":host{background-color:#fff}.container{max-width:100%;margin-top:60px;padding-top:15px}.frame{width:100%;height:100%;border:0px}\n"] }]
591
- }], ctorParameters: function () {
592
- return [{ type: AuthenticationService }, { type: i2$1.DomSanitizer }, { type: i2.Router }, { type: i4$1.Location }, { type: i0.Renderer2 }, { type: undefined, decorators: [{
593
- type: Inject,
594
- args: [AUTHENTICATION_ROUTE]
595
- }] }];
596
- }, propDecorators: { iframe: [{
597
- type: ViewChild,
598
- args: ["iframe", { static: true }]
599
- }] } });
600
-
601
- /*
602
- * Copyright (c) 2016 Huntsman Cancer Institute at the University of Utah, Confidential and Proprietary
603
- */
604
- class DirectLoginComponent {
605
- constructor(_authenticationService, _formBuilder) {
606
- this._authenticationService = _authenticationService;
607
- this._formBuilder = _formBuilder;
608
- }
609
- /**
610
- * Initializes the authentication form.
611
- */
612
- ngOnInit() {
613
- this._loginForm = this._formBuilder.group({
614
- username: ["", Validators.required],
615
- password: ["", Validators.required]
616
- });
617
- }
618
- /**
619
- * A function to submit the login form the the {@link UserService}.
620
- */
621
- login() {
622
- this._authenticationService.login(this._loginForm.value.username, this._loginForm.value.password)
623
- .subscribe((res) => {
624
- if (res) {
625
- this._errorMsg = null;
626
- this._authenticationService.requestAccessToken(true);
627
- }
628
- }, (error) => {
629
- this._errorMsg = "Please check your username and password.";
630
- });
631
- }
632
- }
633
- DirectLoginComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DirectLoginComponent, deps: [{ token: AuthenticationService }, { token: i2$2.UntypedFormBuilder }], target: i0.ɵɵFactoryTarget.Component });
634
- DirectLoginComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: DirectLoginComponent, selector: "hci-login-form", ngImport: i0, template: `
635
- <div class="container">
636
- <div class="login-box" id="hci-login-form-box">
637
- <div class="login-heading" id="hci-login-form-heading">
638
- <h3>Sign in</h3>
639
- </div>
640
- <div class="panel-body">
641
- <form [formGroup]="_loginForm" (ngSubmit)="login()">
642
- <input formControlName="username" class="form-control" id="username" name="username" placeholder="Username" type="text">
643
- <input formControlName="password" class="form-control" id="password" name="password" type="password" placeholder="Password">
644
-
645
- <div *ngIf="_errorMsg" class="alert-box">
646
- <div class="alert alert-danger">
647
- <h5 class="alert-heading">Authentication Failed</h5>
648
- <span id="hci-login-error" class="alert-text">{{_errorMsg}}</span>
649
- </div>
650
- </div>
651
-
652
- <div class="btn-box">
653
- <button class="btn btn-primary" id="hci-login-form-submit-button" type="submit" [disabled]="!_loginForm.valid">Login</button>
654
- </div>
655
- </form>
656
- </div>
657
- </div>
658
- </div>
659
- `, isInline: true, styles: [".container{max-width:400px;margin-top:20px;padding-top:15px}.login-box{border-radius:10px;box-shadow:0 0 2px #ccc;padding:15px}.login-box .login-heading h3{line-height:1.5;margin:0 0 10px}.login-box .form-control{padding:10px;border:1px solid #ccc}.login-box input[type=password]{margin-bottom:10px;border-top-left-radius:0;border-top-right-radius:0}.login-box input[type=text]{margin-bottom:-1px;border-bottom-right-radius:0;border-bottom-left-radius:0}.login-box .alert-box{margin:10px 0 -5px}.login-box .alert-text{font-size:small}.login-box .btn-box{margin:10px 0 0}\n"], dependencies: [{ kind: "directive", type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] });
660
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DirectLoginComponent, decorators: [{
661
- type: Component,
662
- args: [{ selector: "hci-login-form", template: `
663
- <div class="container">
664
- <div class="login-box" id="hci-login-form-box">
665
- <div class="login-heading" id="hci-login-form-heading">
666
- <h3>Sign in</h3>
667
- </div>
668
- <div class="panel-body">
669
- <form [formGroup]="_loginForm" (ngSubmit)="login()">
670
- <input formControlName="username" class="form-control" id="username" name="username" placeholder="Username" type="text">
671
- <input formControlName="password" class="form-control" id="password" name="password" type="password" placeholder="Password">
672
-
673
- <div *ngIf="_errorMsg" class="alert-box">
674
- <div class="alert alert-danger">
675
- <h5 class="alert-heading">Authentication Failed</h5>
676
- <span id="hci-login-error" class="alert-text">{{_errorMsg}}</span>
677
- </div>
678
- </div>
679
-
680
- <div class="btn-box">
681
- <button class="btn btn-primary" id="hci-login-form-submit-button" type="submit" [disabled]="!_loginForm.valid">Login</button>
682
- </div>
683
- </form>
684
- </div>
685
- </div>
686
- </div>
687
- `, styles: [".container{max-width:400px;margin-top:20px;padding-top:15px}.login-box{border-radius:10px;box-shadow:0 0 2px #ccc;padding:15px}.login-box .login-heading h3{line-height:1.5;margin:0 0 10px}.login-box .form-control{padding:10px;border:1px solid #ccc}.login-box input[type=password]{margin-bottom:10px;border-top-left-radius:0;border-top-right-radius:0}.login-box input[type=text]{margin-bottom:-1px;border-bottom-right-radius:0;border-bottom-left-radius:0}.login-box .alert-box{margin:10px 0 -5px}.login-box .alert-text{font-size:small}.login-box .btn-box{margin:10px 0 0}\n"] }]
688
- }], ctorParameters: function () { return [{ type: AuthenticationService }, { type: i2$2.UntypedFormBuilder }]; } });
689
-
690
- /*
691
- * Copyright (c) 2016 Huntsman Cancer Institute at the University of Utah, Confidential and Proprietary
692
- */
693
- class TimeoutNotificationComponent {
694
- constructor(authenticationService) {
695
- this.authenticationService = authenticationService;
696
- this.openState = "hidden";
697
- authenticationService.isAboutToTimeOut().subscribe((isAboutToTimeOut) => {
698
- if (isAboutToTimeOut) {
699
- this.openState = "opened";
700
- this.startCountdown();
701
- }
702
- else {
703
- this.openState = "hidden";
704
- //If something changed mid-timeout, cancel the timeout/logout.
705
- if (this.subscription != null && !this.subscription.closed) {
706
- this.subscription.unsubscribe();
707
- }
708
- }
709
- });
710
- }
711
- startCountdown() {
712
- this.seconds = timer(0, 1000)
713
- .pipe(map(() => {
714
- const elapsed = Math.round((Date.now() - this.authenticationService.getTimeoutStart()) / 1000);
715
- return this.authenticationService.userCountdownSeconds - elapsed;
716
- }),
717
- // The true argument emits the final value that completed the observable
718
- takeWhile((value) => value > 0, true));
719
- this.subscription = this.seconds.subscribe((value) => {
720
- if (value < 1) {
721
- this.subscription.unsubscribe();
722
- this.authenticationService.logout(true);
723
- }
724
- });
725
- }
726
- click() {
727
- this.subscription.unsubscribe();
728
- this.authenticationService.updateUserActivity();
729
- }
730
- }
731
- TimeoutNotificationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TimeoutNotificationComponent, deps: [{ token: AuthenticationService }], target: i0.ɵɵFactoryTarget.Component });
732
- TimeoutNotificationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: TimeoutNotificationComponent, selector: "timeout-notification", ngImport: i0, template: `
733
- <div class="flyout-max" [@openBacksplash]="openState">
734
- <div class="modal-dialog" [@openModal]="openState" role="document">
735
- <div class="modal-header">
736
- <h4 class="modal-title">Your Session Is About To Expire</h4>
737
- </div>
738
- <div class="modal-body">
739
- <p>For your security, your session is about to automatically time out in the next <b>{{seconds | async}}</b> seconds. Would you like to stay signed in?</p>
740
- </div>
741
- <div class="modal-footer">
742
- <ng-container>
743
- <button id="updateBtn" type="button" class="btn btn-secondary" (click)="click()">Yes, Keep me signed in</button>
744
- </ng-container>
745
- </div>
746
- </div>
747
- </div>
748
- `, isInline: true, styles: [".flyout-max{position:fixed;z-index:9999;top:0;bottom:0;background-color:#0006;width:100vw}.modal-dialog{position:fixed;max-width:50vw;min-width:50vw;left:-50vw;top:25vw;margin:0;background-color:#fff;border:black 1px solid;border-left:none;border-radius:20px;pointer-events:all}.modal-body{width:100%;display:inline-block}.modal-body-left{display:inline-block;overflow-y:auto;overflow-x:hidden;min-height:300px;max-height:300px}.modal-body-right{width:70%;vertical-align:top;padding-left:15px;border-left:black 1px solid;margin-left:15px;display:inline-block;overflow-y:auto;min-height:300px;max-height:300px}\n"], dependencies: [{ kind: "pipe", type: i4$1.AsyncPipe, name: "async" }], animations: [
749
- trigger("openBacksplash", [
750
- state("in", style({
751
- "display": "none"
752
- })),
753
- state("hidden", style({
754
- "display": "none"
755
- })),
756
- state("opened", style({
757
- "display": "inherit"
758
- })),
759
- transition("hidden => opened", animate(100)),
760
- transition("opened => hidden", animate(200))
761
- ]),
762
- trigger("openModal", [
763
- state("in", style({
764
- "opacity": "0",
765
- "left": "-50vw"
766
- })),
767
- state("hidden", style({
768
- "opacity": "0",
769
- "left": "-50vw"
770
- })),
771
- state("opened", style({
772
- "opacity": "1",
773
- "left": "25vw"
774
- })),
775
- transition("hidden => opened", animate(500)),
776
- transition("opened => hidden", animate(300))
777
- ])
778
- ] });
779
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TimeoutNotificationComponent, decorators: [{
780
- type: Component,
781
- args: [{ selector: "timeout-notification", template: `
782
- <div class="flyout-max" [@openBacksplash]="openState">
783
- <div class="modal-dialog" [@openModal]="openState" role="document">
784
- <div class="modal-header">
785
- <h4 class="modal-title">Your Session Is About To Expire</h4>
786
- </div>
787
- <div class="modal-body">
788
- <p>For your security, your session is about to automatically time out in the next <b>{{seconds | async}}</b> seconds. Would you like to stay signed in?</p>
789
- </div>
790
- <div class="modal-footer">
791
- <ng-container>
792
- <button id="updateBtn" type="button" class="btn btn-secondary" (click)="click()">Yes, Keep me signed in</button>
793
- </ng-container>
794
- </div>
795
- </div>
796
- </div>
797
- `, animations: [
798
- trigger("openBacksplash", [
799
- state("in", style({
800
- "display": "none"
801
- })),
802
- state("hidden", style({
803
- "display": "none"
804
- })),
805
- state("opened", style({
806
- "display": "inherit"
807
- })),
808
- transition("hidden => opened", animate(100)),
809
- transition("opened => hidden", animate(200))
810
- ]),
811
- trigger("openModal", [
812
- state("in", style({
813
- "opacity": "0",
814
- "left": "-50vw"
815
- })),
816
- state("hidden", style({
817
- "opacity": "0",
818
- "left": "-50vw"
819
- })),
820
- state("opened", style({
821
- "opacity": "1",
822
- "left": "25vw"
823
- })),
824
- transition("hidden => opened", animate(500)),
825
- transition("opened => hidden", animate(300))
826
- ])
827
- ], styles: [".flyout-max{position:fixed;z-index:9999;top:0;bottom:0;background-color:#0006;width:100vw}.modal-dialog{position:fixed;max-width:50vw;min-width:50vw;left:-50vw;top:25vw;margin:0;background-color:#fff;border:black 1px solid;border-left:none;border-radius:20px;pointer-events:all}.modal-body{width:100%;display:inline-block}.modal-body-left{display:inline-block;overflow-y:auto;overflow-x:hidden;min-height:300px;max-height:300px}.modal-body-right{width:70%;vertical-align:top;padding-left:15px;border-left:black 1px solid;margin-left:15px;display:inline-block;overflow-y:auto;min-height:300px;max-height:300px}\n"] }]
828
- }], ctorParameters: function () { return [{ type: AuthenticationService }]; } });
829
-
830
- class AuthorizationInterceptor {
831
- constructor(injector) {
832
- this.injector = injector;
833
- }
834
- intercept(req, next) {
835
- if (isDevMode()) {
836
- console.debug("AuthorizationInterceptor.intercept");
837
- }
838
- let authService = this.injector.get(AuthenticationService);
839
- //Don't want to include background token refreshes in considering the user 'active'
840
- if (req.url !== authService.tokenLocation()) {
841
- //Update user activity. Done here instead of the previous method using a subscription to a subject in AuthenticationProvider
842
- authService.updateUserActivity();
843
- }
844
- let headers = authService.getHeaders(req);
845
- let url = req.url;
846
- if (url.startsWith("/")) {
847
- url = authService.getBaseUrl() + url;
848
- }
849
- else if (!url.startsWith("http")) {
850
- if (authService.getContextRoot().length > 0) {
851
- url = authService.getBaseUrl() + "/" + authService.getContextRoot() + "/" + url;
852
- }
853
- else {
854
- url = authService.getBaseUrl() + "/" + url;
855
- }
856
- }
857
- let params = req.params;
858
- if (url.indexOf("/crud/") > 0) {
859
- params = params.set("maxViewPermission", authService.getMaxViewPermission());
860
- }
861
- let reqClone = req.clone({
862
- url: url,
863
- withCredentials: true,
864
- headers: headers,
865
- params: params
866
- });
867
- return next.handle(reqClone)
868
- .pipe(catchError((error) => {
869
- if (isDevMode()) {
870
- console.error("AuthorizationInterceptor.error");
871
- console.error(error);
872
- }
873
- /**
874
- * If the token is not authenticated which angular does not know about, then a REST request to the backend will
875
- * return a 401. To duplicate this, open Core in two tabs. In one tab, logout, in the other, perform a request
876
- * that hits a protected resource.
877
- */
878
- if (error.status === 401) {
879
- authService.isAuthenticated().subscribe((authenticated) => {
880
- if (authenticated) {
881
- // If authenticated, then logout which will redirect.
882
- authService.logout(true);
883
- return throwError(error.message);
884
- }
885
- else {
886
- // Otherwise, for example, when the user first opens Core, 401s are expected.
887
- return throwError(error);
888
- }
889
- });
890
- }
891
- if (error.status === 403) {
892
- // TODO: Trigger notification for unauthorized.
893
- }
894
- return throwError(error);
895
- }));
896
- }
897
- }
898
- AuthorizationInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthorizationInterceptor, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
899
- AuthorizationInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthorizationInterceptor });
900
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthorizationInterceptor, decorators: [{
901
- type: Injectable
902
- }], ctorParameters: function () { return [{ type: i0.Injector }]; } });
903
-
904
- /*
905
- * Copyright (c) 2016 Huntsman Cancer Institute at the University of Utah, Confidential and Proprietary
906
- */
907
- /**
908
- * Provide a single auth service and interceptor for the implementing application. Also provide everything
909
- * from the angular-jwt library.
910
- *
911
- * @since 1.0.0
912
- */
913
- class AuthenticationModule {
914
- constructor(parentModule) {
915
- if (parentModule) {
916
- throw new Error("AuthenticationModule is already loaded.");
917
- }
918
- }
919
- static forRoot() {
920
- return {
921
- providers: [
922
- AuthenticationProvider,
923
- JwtHelperService,
924
- AuthenticationService,
925
- RouteGuardService,
926
- {
927
- provide: HTTP_INTERCEPTORS,
928
- useClass: AuthorizationInterceptor,
929
- multi: true
930
- },
931
- {
932
- provide: HTTP_INTERCEPTORS,
933
- useClass: JwtInterceptor,
934
- multi: true
935
- },
936
- {
937
- provide: JWT_OPTIONS,
938
- useClass: AuthenticationProvider
939
- }
940
- ],
941
- ngModule: AuthenticationModule
942
- };
943
- }
944
- }
945
- AuthenticationModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthenticationModule, deps: [{ token: i4.JwtModule, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.NgModule });
946
- AuthenticationModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: AuthenticationModule, declarations: [AuthenticationComponent,
947
- DirectLoginComponent,
948
- TimeoutNotificationComponent], imports: [CommonModule,
949
- HttpClientModule,
950
- //JwtModule,
951
- RouterModule,
952
- FormsModule,
953
- ReactiveFormsModule,
954
- CoolStorageModule], exports: [AuthenticationComponent,
955
- DirectLoginComponent,
956
- TimeoutNotificationComponent] });
957
- AuthenticationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthenticationModule, imports: [CommonModule,
958
- HttpClientModule,
959
- //JwtModule,
960
- RouterModule,
961
- FormsModule,
962
- ReactiveFormsModule,
963
- CoolStorageModule] });
964
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthenticationModule, decorators: [{
965
- type: NgModule,
966
- args: [{
967
- imports: [
968
- CommonModule,
969
- HttpClientModule,
970
- //JwtModule,
971
- RouterModule,
972
- FormsModule,
973
- ReactiveFormsModule,
974
- CoolStorageModule
975
- ],
976
- declarations: [
977
- AuthenticationComponent,
978
- DirectLoginComponent,
979
- TimeoutNotificationComponent
980
- ],
981
- exports: [
982
- AuthenticationComponent,
983
- DirectLoginComponent,
984
- TimeoutNotificationComponent
985
- ]
986
- }]
987
- }], ctorParameters: function () {
988
- return [{ type: i4.JwtModule, decorators: [{
989
- type: Optional
990
- }, {
991
- type: SkipSelf
992
- }] }];
993
- } });
994
-
995
- /**
996
- * Generated bundle index. Do not edit.
997
- */
998
-
999
- export { AUTHENTICATION_DIRECT_ENDPOINT, AUTHENTICATION_IDP_INACTIVITY_MINUTES, AUTHENTICATION_LOGOUT_PATH, AUTHENTICATION_MAX_INACTIVITY_MINUTES, AUTHENTICATION_ROUTE, AUTHENTICATION_SERVER_URL, AUTHENTICATION_TOKEN_ENDPOINT, AUTHENTICATION_TOKEN_KEY, AUTHENTICATION_USER_COUNTDOWN_SECONDS, AuthenticationComponent, AuthenticationModule, AuthenticationService, AuthorizationInterceptor, DirectLoginComponent, RouteGuardService, TimeoutNotificationComponent };
1000
- //# sourceMappingURL=huntsman-cancer-institute-authentication.mjs.map