= new ReplaySubject();
menuIsOpen = false;
@Input()
@@ -26,10 +23,9 @@ export class ApplicationTopBarComponent implements OnInit, OnDestroy {
private subscription?: Subscription;
constructor(
- private oauthService: OAuthService,
+ private oauthService: OidcSecurityService,
private configService: ConfigService,
private dialog: MatDialog,
- private router: Router,
private refreshDataService: RefreshDataService,
) {}
@@ -41,10 +37,6 @@ export class ApplicationTopBarComponent implements OnInit, OnDestroy {
}
},
});
-
- if (this.oauthService.hasValidIdToken()) {
- this.username.next(this.oauthService.getIdentityClaims()['name']);
- }
}
ngOnDestroy(): void {
@@ -52,10 +44,11 @@ export class ApplicationTopBarComponent implements OnInit, OnDestroy {
}
logOut() {
- const currentUrlTree = this.router.createUrlTree([], { queryParams: {} });
- this.router.navigateByUrl(currentUrlTree).then(() => {
- this.oauthService.logOut();
- });
+ this.oauthService.logoff().subscribe();
+ }
+
+ username() {
+ return this.oauthService.getUserData().pipe(map((user) => user?.name || ''));
}
openTeamManagement() {
diff --git a/frontend/src/app/callback/callback.component.css b/frontend/src/app/callback/callback.component.css
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/frontend/src/app/callback/callback.component.html b/frontend/src/app/callback/callback.component.html
new file mode 100644
index 0000000000..9a5f2cf345
--- /dev/null
+++ b/frontend/src/app/callback/callback.component.html
@@ -0,0 +1 @@
+You are getting forwarded!
diff --git a/frontend/src/app/callback/callback.component.ts b/frontend/src/app/callback/callback.component.ts
new file mode 100644
index 0000000000..ac042fdc53
--- /dev/null
+++ b/frontend/src/app/callback/callback.component.ts
@@ -0,0 +1,8 @@
+import { Component } from '@angular/core';
+
+@Component({
+ selector: 'app-callback',
+ templateUrl: './callback.component.html',
+ styleUrl: './callback.component.css',
+})
+export class CallbackComponent {}
diff --git a/frontend/src/app/objective-filter/objective-filter.component.spec.ts b/frontend/src/app/objective-filter/objective-filter.component.spec.ts
index 8a7c431786..0eab0ac2af 100644
--- a/frontend/src/app/objective-filter/objective-filter.component.spec.ts
+++ b/frontend/src/app/objective-filter/objective-filter.component.spec.ts
@@ -15,6 +15,8 @@ import { Router } from '@angular/router';
import { RouterTestingHarness } from '@angular/router/testing';
import { authGuard } from '../shared/guards/auth.guard';
import { OverviewComponent } from '../overview/overview.component';
+import { AbstractLoggerService, AutoLoginPartialRoutesGuard, StsConfigLoader } from 'angular-auth-oidc-client';
+import { of } from 'rxjs';
describe('ObjectiveFilterComponent', () => {
let component: ObjectiveFilterComponent;
@@ -22,17 +24,26 @@ describe('ObjectiveFilterComponent', () => {
let loader: HarnessLoader;
let router: Router;
- const authGuardMock = () => {
- return Promise.resolve(true);
- };
-
beforeEach(() => {
TestBed.configureTestingModule({
declarations: [ObjectiveFilterComponent, OverviewComponent],
providers: [
{
- provide: authGuard,
- useValue: authGuardMock,
+ provide: StsConfigLoader,
+ useValue: {
+ loadConfig: () => of({}),
+ loadConfigs: () => of([{}]),
+ },
+ },
+ {
+ provide: AbstractLoggerService,
+ useValue: {
+ logError: () => of({}),
+ },
+ },
+ {
+ provide: AutoLoginPartialRoutesGuard,
+ useValue: () => Promise.resolve(true),
},
],
imports: [
diff --git a/frontend/src/app/overview/overview.component.spec.ts b/frontend/src/app/overview/overview.component.spec.ts
index 4599cb1e60..661e6838d4 100644
--- a/frontend/src/app/overview/overview.component.spec.ts
+++ b/frontend/src/app/overview/overview.component.spec.ts
@@ -1,5 +1,4 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
-
import { OverviewComponent } from './overview.component';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { overViewEntity1 } from '../shared/testData';
@@ -11,11 +10,12 @@ import { RefreshDataService } from '../shared/services/refresh-data.service';
import { authGuard } from '../shared/guards/auth.guard';
import { ApplicationBannerComponent } from '../application-banner/application-banner.component';
import { ApplicationTopBarComponent } from '../application-top-bar/application-top-bar.component';
-import { DateTimeProvider, OAuthLogger, OAuthService, UrlHelperService } from 'angular-oauth2-oidc';
import { MatDialogModule, MatDialogRef } from '@angular/material/dialog';
import { MatIconModule } from '@angular/material/icon';
import { MatMenuModule } from '@angular/material/menu';
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
+import { AbstractLoggerService, AutoLoginPartialRoutesGuard, StsConfigLoader } from 'angular-auth-oidc-client';
+import { NgOptimizedImage } from '@angular/common';
const overviewService = {
getOverview: jest.fn(),
@@ -46,7 +46,14 @@ describe('OverviewComponent', () => {
let fixture: ComponentFixture;
beforeEach(async () => {
await TestBed.configureTestingModule({
- imports: [HttpClientTestingModule, AppRoutingModule, MatDialogModule, MatIconModule, MatMenuModule],
+ imports: [
+ HttpClientTestingModule,
+ AppRoutingModule,
+ MatDialogModule,
+ MatIconModule,
+ MatMenuModule,
+ NgOptimizedImage,
+ ],
declarations: [OverviewComponent, ApplicationBannerComponent, ApplicationTopBarComponent],
providers: [
{
@@ -54,8 +61,8 @@ describe('OverviewComponent', () => {
useValue: overviewService,
},
{
- provide: authGuard,
- useValue: authGuardMock,
+ provide: AutoLoginPartialRoutesGuard,
+ useValue: () => Promise.resolve(true),
},
{
provide: RefreshDataService,
@@ -65,10 +72,19 @@ describe('OverviewComponent', () => {
provide: MatDialogRef,
useValue: {},
},
- OAuthService,
- UrlHelperService,
- OAuthLogger,
- DateTimeProvider,
+ {
+ provide: StsConfigLoader,
+ useValue: {
+ loadConfig: () => of({}),
+ loadConfigs: () => of([{}]),
+ },
+ },
+ {
+ provide: AbstractLoggerService,
+ useValue: {
+ logError: () => of({}),
+ },
+ },
],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
}).compileComponents();
diff --git a/frontend/src/app/shared/dialog/key-result-form/key-result-form.component.spec.ts b/frontend/src/app/shared/dialog/key-result-form/key-result-form.component.spec.ts
index 70df372799..1b4292e762 100644
--- a/frontend/src/app/shared/dialog/key-result-form/key-result-form.component.spec.ts
+++ b/frontend/src/app/shared/dialog/key-result-form/key-result-form.component.spec.ts
@@ -15,7 +15,6 @@ import { MatRadioModule } from '@angular/material/radio';
import { KeyResultObjective } from '../../types/model/KeyResultObjective';
import { User } from '../../types/model/User';
import { DialogHeaderComponent } from '../../custom/dialog-header/dialog-header.component';
-import { OAuthService } from 'angular-oauth2-oidc';
import { KeyresultTypeComponent } from '../../../keyresult-type/keyresult-type.component';
import { ActionPlanComponent } from '../../../action-plan/action-plan.component';
import { TranslateModule, TranslateService } from '@ngx-translate/core';
@@ -26,15 +25,17 @@ import { Action } from '../../types/model/Action';
import { KeyResultMetric } from '../../types/model/KeyResultMetric';
import { KeyResultOrdinal } from '../../types/model/KeyResultOrdinal';
import { TranslateTestingModule } from 'ngx-translate-testing';
+// @ts-ignore
import * as de from '../../../../assets/i18n/de.json';
+import { OidcSecurityService } from 'angular-auth-oidc-client';
describe('KeyResultFormComponent', () => {
let component: KeyResultFormComponent;
let fixture: ComponentFixture;
const oauthMockService = {
- getIdentityClaims() {
- return { name: users[1].firstname + ' ' + users[1].lastname };
+ getUserData() {
+ return of({ name: users[1].firstname + ' ' + users[1].lastname });
},
};
@@ -115,7 +116,7 @@ describe('KeyResultFormComponent', () => {
useValue: matDialogRefMock,
},
{
- provide: OAuthService,
+ provide: OidcSecurityService,
useValue: oauthMockService,
},
],
@@ -233,7 +234,9 @@ describe('KeyResultFormComponent', () => {
});
it('should get username from oauthService right', () => {
- expect(component.getUserName()).toEqual('Paco Egiman');
+ component.getUserName().subscribe((userName) => {
+ expect(userName).toEqual('Paco Egiman');
+ });
});
});
});
diff --git a/frontend/src/app/shared/dialog/key-result-form/key-result-form.component.ts b/frontend/src/app/shared/dialog/key-result-form/key-result-form.component.ts
index e273ab0e93..04dd1535b2 100644
--- a/frontend/src/app/shared/dialog/key-result-form/key-result-form.component.ts
+++ b/frontend/src/app/shared/dialog/key-result-form/key-result-form.component.ts
@@ -4,12 +4,12 @@ import { User } from '../../types/model/User';
import { KeyResult } from '../../types/model/KeyResult';
import { KeyResultMetric } from '../../types/model/KeyResultMetric';
import { KeyResultOrdinal } from '../../types/model/KeyResultOrdinal';
-import { BehaviorSubject, filter, map, Observable, of, startWith, switchMap } from 'rxjs';
+import { BehaviorSubject, filter, map, Observable, of, startWith, switchMap, tap } from 'rxjs';
import { UserService } from '../../services/user.service';
import { Action } from '../../types/model/Action';
import { formInputCheck, hasFormFieldErrors } from '../../common';
-import { OAuthService } from 'angular-oauth2-oidc';
import { TranslateService } from '@ngx-translate/core';
+import { OidcSecurityService } from 'angular-auth-oidc-client';
@Component({
selector: 'app-key-result-form',
@@ -31,7 +31,7 @@ export class KeyResultFormComponent implements OnInit {
constructor(
public userService: UserService,
- private oauthService: OAuthService,
+ private oauthService: OidcSecurityService,
private translate: TranslateService,
) {}
@@ -62,11 +62,12 @@ export class KeyResultFormComponent implements OnInit {
]);
this.users$.subscribe((users) => {
- const loggedInUser = this.getUserName();
- users.forEach((user) => {
- if (user.firstname + ' ' + user.lastname === loggedInUser) {
- this.keyResultForm.controls['owner'].setValue(user);
- }
+ this.getUserName().subscribe((userName) => {
+ users.forEach((user) => {
+ if (user.firstname + ' ' + user.lastname === userName) {
+ this.keyResultForm.controls['owner'].setValue(user);
+ }
+ });
});
});
}
@@ -131,6 +132,6 @@ export class KeyResultFormComponent implements OnInit {
updateFormValidity() {}
getUserName() {
- return this.oauthService.getIdentityClaims()['name'];
+ return this.oauthService.getUserData().pipe(map((user) => user?.name || ''));
}
}
diff --git a/frontend/src/app/shared/dialog/keyresult-dialog/keyresult-dialog.component.spec.ts b/frontend/src/app/shared/dialog/keyresult-dialog/keyresult-dialog.component.spec.ts
index 0f94499113..4ed5d5d686 100644
--- a/frontend/src/app/shared/dialog/keyresult-dialog/keyresult-dialog.component.spec.ts
+++ b/frontend/src/app/shared/dialog/keyresult-dialog/keyresult-dialog.component.spec.ts
@@ -17,13 +17,13 @@ import { MatSelectModule } from '@angular/material/select';
import { MatRadioModule } from '@angular/material/radio';
import { KeyResultObjective } from '../../types/model/KeyResultObjective';
import { DialogHeaderComponent } from '../../custom/dialog-header/dialog-header.component';
-import { OAuthService } from 'angular-oauth2-oidc';
import { KeyresultTypeComponent } from '../../../keyresult-type/keyresult-type.component';
import { ActionPlanComponent } from '../../../action-plan/action-plan.component';
import { TranslateModule, TranslateService } from '@ngx-translate/core';
import { DragDropModule } from '@angular/cdk/drag-drop';
import { UserService } from '../../services/user.service';
import { KeyResultFormComponent } from '../key-result-form/key-result-form.component';
+import { OidcSecurityService } from 'angular-auth-oidc-client';
describe('KeyresultDialogComponent', () => {
let component: KeyresultDialogComponent;
@@ -31,8 +31,8 @@ describe('KeyresultDialogComponent', () => {
let keyResultService: KeyresultService;
const oauthMockService = {
- getIdentityClaims() {
- return { name: users[1].firstname + ' ' + users[1].lastname };
+ getUserData() {
+ return of({ name: users[1].firstname + ' ' + users[1].lastname });
},
};
@@ -277,7 +277,7 @@ describe('KeyresultDialogComponent', () => {
useValue: { objective: fullObjective, keyResult: undefined },
},
{
- provide: OAuthService,
+ provide: OidcSecurityService,
useValue: oauthMockService,
},
],
@@ -419,7 +419,7 @@ describe('KeyresultDialogComponent', () => {
},
},
{
- provide: OAuthService,
+ provide: OidcSecurityService,
useValue: oauthMockService,
},
{
@@ -562,7 +562,7 @@ describe('KeyresultDialogComponent', () => {
useValue: matDialogRefMock,
},
{
- provide: OAuthService,
+ provide: OidcSecurityService,
useValue: oauthMockService,
},
{
diff --git a/frontend/src/app/shared/guards/auth.guard.spec.ts b/frontend/src/app/shared/guards/auth.guard.spec.ts
index 4e13f0c262..318fae4558 100644
--- a/frontend/src/app/shared/guards/auth.guard.spec.ts
+++ b/frontend/src/app/shared/guards/auth.guard.spec.ts
@@ -1,61 +1,56 @@
import { TestBed } from '@angular/core/testing';
-import { CanActivateFn } from '@angular/router';
+import { ActivatedRouteSnapshot, CanActivateFn, RouterStateSnapshot } from '@angular/router';
import { authGuard } from './auth.guard';
-import { OAuthService } from 'angular-oauth2-oidc';
+import { OidcSecurityService } from 'angular-auth-oidc-client';
+import { of } from 'rxjs';
const oAuthMock = {
- initCodeFlow: jest.fn(),
- loadDiscoveryDocumentAndTryLogin: jest.fn(),
- hasValidIdToken: jest.fn(),
- setupAutomaticSilentRefresh: jest.fn(),
+ get isAuthenticated$() {
+ return of({});
+ },
};
describe('authGuard', () => {
const executeGuard: CanActivateFn = (...guardParameters) =>
TestBed.runInInjectionContext(() => authGuard(...guardParameters));
+ const route: ActivatedRouteSnapshot = {} as any;
+ const state: RouterStateSnapshot = {} as any;
beforeEach(() => {
TestBed.configureTestingModule({
providers: [
{
- provide: OAuthService,
+ provide: OidcSecurityService,
useValue: oAuthMock,
},
],
});
- jest.spyOn(oAuthMock, 'initCodeFlow').mockReturnValue(true);
- jest.spyOn(oAuthMock, 'loadDiscoveryDocumentAndTryLogin').mockReturnValue(Promise.resolve(true));
- jest.spyOn(oAuthMock, 'setupAutomaticSilentRefresh').mockReturnValue(true);
- oAuthMock.initCodeFlow.mockReset();
- oAuthMock.setupAutomaticSilentRefresh.mockReset();
});
it('should be created', () => {
expect(executeGuard).toBeTruthy();
});
- it('should not call initCodeFlow if token is valid', async () => {
- jest.spyOn(oAuthMock, 'hasValidIdToken').mockReturnValue(true);
- const result = await runAuthGuardWithContext(authGuard);
+ it('should return true if token valid ', async () => {
+ jest.spyOn(oAuthMock, 'isAuthenticated$', 'get').mockReturnValue(of({ isAuthenticated: true }));
+ const result$ = runAuthGuardWithContext(authGuard, route, state);
- expect(result).toBe(true);
- expect(oAuthMock.loadDiscoveryDocumentAndTryLogin).toHaveBeenCalled();
- expect(oAuthMock.initCodeFlow).not.toHaveBeenCalled();
- expect(oAuthMock.setupAutomaticSilentRefresh).toHaveBeenCalled();
+ result$.then((result) => {
+ expect(result).toBe(true);
+ });
});
- it('should call initCodeFlow if token is invalid', async () => {
- jest.spyOn(oAuthMock, 'hasValidIdToken').mockReturnValue(false);
- const result = await runAuthGuardWithContext(authGuard);
+ it('should return false if token invalid', async () => {
+ jest.spyOn(oAuthMock, 'isAuthenticated$', 'get').mockReturnValue(of({ isAuthenticated: false }));
+ const result$ = runAuthGuardWithContext(authGuard, route, state);
- expect(result).toBe(false);
- expect(oAuthMock.loadDiscoveryDocumentAndTryLogin).toHaveBeenCalled();
- expect(oAuthMock.initCodeFlow).toHaveBeenCalled();
- expect(oAuthMock.setupAutomaticSilentRefresh).not.toHaveBeenCalled();
+ result$.then((result) => {
+ expect(result).toBe(false);
+ });
});
- async function runAuthGuardWithContext(authGuard: any): Promise {
- return await TestBed.runInInjectionContext(authGuard);
+ async function runAuthGuardWithContext(authGuard: any, route: any, state: any): Promise {
+ return await TestBed.runInInjectionContext(() => authGuard(route, state));
}
});
diff --git a/frontend/src/app/shared/guards/auth.guard.ts b/frontend/src/app/shared/guards/auth.guard.ts
index 137380edbe..6160c00ac4 100644
--- a/frontend/src/app/shared/guards/auth.guard.ts
+++ b/frontend/src/app/shared/guards/auth.guard.ts
@@ -1,18 +1,20 @@
-import { CanActivateFn } from '@angular/router';
+import { CanActivateFn, Router } from '@angular/router';
import { inject } from '@angular/core';
-import { OAuthService } from 'angular-oauth2-oidc';
+import { OidcSecurityService } from 'angular-auth-oidc-client';
+import { map, take, tap } from 'rxjs';
+//Not used, can be deleted
export const authGuard: CanActivateFn = (route, state) => {
- const oauthService = inject(OAuthService);
- return oauthService.loadDiscoveryDocumentAndTryLogin().then(async () => {
- // if the login failed initialize code flow
- let validToken = oauthService.hasValidIdToken();
- if (!validToken) {
- oauthService.initCodeFlow();
- return false;
- }
- oauthService.setupAutomaticSilentRefresh();
- location.hash = '';
- return true;
- });
+ const oidcSecurityService = inject(OidcSecurityService);
+ // console.log(oidcSecurityService.isAuthenticated$.subscribe(console.log));
+
+ return oidcSecurityService.isAuthenticated$.pipe(
+ take(1),
+ map(({ isAuthenticated }) => {
+ // allow navigation if authenticated
+ return isAuthenticated;
+
+ // redirect if not authenticated
+ }),
+ );
};
diff --git a/frontend/src/app/shared/interceptors/oauth.interceptor.spec.ts b/frontend/src/app/shared/interceptors/oauth.interceptor.spec.ts
index 8650d459c9..1ee37d9d4d 100644
--- a/frontend/src/app/shared/interceptors/oauth.interceptor.spec.ts
+++ b/frontend/src/app/shared/interceptors/oauth.interceptor.spec.ts
@@ -2,13 +2,23 @@ import { TestBed } from '@angular/core/testing';
import { OauthInterceptor } from './oauth.interceptor';
import { HttpClientTestingModule } from '@angular/common/http/testing';
-import { DateTimeProvider, OAuthLogger, OAuthModule, OAuthService, UrlHelperService } from 'angular-oauth2-oidc';
+import { OidcSecurityService, StsConfigLoader } from 'angular-auth-oidc-client';
+import { of } from 'rxjs';
describe('OauthInterceptor', () => {
beforeEach(() =>
TestBed.configureTestingModule({
imports: [HttpClientTestingModule],
- providers: [OAuthService, UrlHelperService, OAuthLogger, DateTimeProvider, OAuthService],
+ providers: [
+ OidcSecurityService,
+ {
+ provide: StsConfigLoader,
+ useValue: {
+ loadConfig: () => of({}),
+ loadConfigs: () => of([{}]),
+ },
+ },
+ ],
}),
);
diff --git a/frontend/src/app/shared/interceptors/oauth.interceptor.ts b/frontend/src/app/shared/interceptors/oauth.interceptor.ts
index 0b96fa28b6..a4ec56f49b 100644
--- a/frontend/src/app/shared/interceptors/oauth.interceptor.ts
+++ b/frontend/src/app/shared/interceptors/oauth.interceptor.ts
@@ -1,26 +1,19 @@
import { Injectable } from '@angular/core';
import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';
import { filter, map, merge, mergeMap, Observable, of, take, timeout } from 'rxjs';
-import { OAuthService } from 'angular-oauth2-oidc';
+import { OidcSecurityService } from 'angular-auth-oidc-client';
@Injectable({
providedIn: 'root',
})
export class OauthInterceptor implements HttpInterceptor {
- constructor(private oauthService: OAuthService) {}
+ constructor(private oauthService: OidcSecurityService) {}
intercept(req: HttpRequest, next: HttpHandler): Observable> {
if (!req.url.match(/^(\/)?api/)) {
return next.handle(req);
}
- return merge(
- of(this.oauthService.getAccessToken()).pipe(filter((token) => !!token)),
- this.oauthService.events.pipe(
- filter((e) => e.type === 'token_received'),
- timeout(500),
- map((_) => this.oauthService.getAccessToken()),
- ),
- ).pipe(
+ return this.oauthService.getAccessToken().pipe(
take(1),
mergeMap((token) => {
if (token) {
@@ -30,7 +23,6 @@ export class OauthInterceptor implements HttpInterceptor {
}
return next.handle(req);
- // .pipe(catchError((err) => this.errorHandler.handleError(err)));
}),
);
}
diff --git a/frontend/src/environments/environment.prod.ts b/frontend/src/environments/environment.prod.ts
index 0bfbf9d09f..0f14293fee 100644
--- a/frontend/src/environments/environment.prod.ts
+++ b/frontend/src/environments/environment.prod.ts
@@ -1,19 +1,22 @@
-import { AuthConfig } from 'angular-oauth2-oidc';
+import { OpenIdConfiguration } from 'angular-auth-oidc-client';
export const environment = {
production: true,
staging: false,
oauth: {
- decreaseExpirationBySec: 30,
- clearHashAfterLogin: true,
- issuer: 'https://sso.puzzle.ch/auth/realms/pitc',
- strictDiscoveryDocumentValidation: false,
- // redirectUri: 'http://localhost:8080/auth/keycloakopenid/callback',
+ authority: 'https://sso.puzzle.ch/auth/realms/pitc',
// redirectUri: `${window.location.protocol}//${window.location.hostname}:${window.location.port}/auth/keycloakopenid/callback${window.location.search}`,
- redirectUri: `${window.location.protocol}//${window.location.hostname}:${window.location.port}`,
- scope: 'profile openid',
+ redirectUrl: window.location.origin + '/callback',
+ postLogoutRedirectUri: window.location.origin,
+ renewTimeBeforeTokenExpiresInSeconds: 30,
+ scope: 'profile openid offline_access',
clientId: 'pitc_okr_prod',
responseType: 'code',
- showDebugInformation: true,
- } as AuthConfig,
+ // showDebugInformation: true,
+ customParamsRefreshTokenRequest: {
+ scope: 'openid profile offline_access',
+ },
+ ignoreNonceAfterRefresh: true, // this is required if the id_token is not returned
+ triggerRefreshWhenIdTokenExpired: false,
+ } as OpenIdConfiguration,
};
diff --git a/frontend/src/environments/environment.ts b/frontend/src/environments/environment.ts
index 6b65b98b9b..6980970211 100644
--- a/frontend/src/environments/environment.ts
+++ b/frontend/src/environments/environment.ts
@@ -2,22 +2,28 @@
// `ng build` replaces `environment.ts` with `environment.prod.ts`.
// The list of file replacements can be found in `angular.json`.
-import { AuthConfig } from 'angular-oauth2-oidc';
+import { LogLevel, OpenIdConfiguration } from 'angular-auth-oidc-client';
export const environment = {
production: false,
staging: false,
oauth: {
- decreaseExpirationBySec: 30,
- clearHashAfterLogin: true,
- issuer: '',
- strictDiscoveryDocumentValidation: false,
- redirectUri: 'http://localhost:4200',
- scope: 'openid profile',
+ issuer: 'http://localhost:8095/auth/realms/pitc',
+ redirectUrl: 'http://localhost:4200/callback',
+ postLogoutRedirectUri: window.location.origin,
+ renewTimeBeforeTokenExpiresInSeconds: 30,
+ scope: 'openid profile offline_access',
clientId: '',
responseType: 'code',
- showDebugInformation: true,
- } as AuthConfig,
+ logLevel: LogLevel.Debug,
+ silentRenew: true,
+ useRefreshToken: true,
+ customParamsRefreshTokenRequest: {
+ scope: 'openid profile offline_access',
+ },
+ ignoreNonceAfterRefresh: true, // this is required if the id_token is not returned
+ triggerRefreshWhenIdTokenExpired: false,
+ } as OpenIdConfiguration,
};
/*