diff --git a/lib/core/src/lib/auth/oidc/auth-config.service.spec.ts b/lib/core/src/lib/auth/oidc/auth-config.service.spec.ts index 9fca3715156..df3f89f9c4f 100644 --- a/lib/core/src/lib/auth/oidc/auth-config.service.spec.ts +++ b/lib/core/src/lib/auth/oidc/auth-config.service.spec.ts @@ -52,7 +52,7 @@ describe('AuthConfigService', () => { secret: '', implicitFlow: true, silentLogin: true, - redirectSilentIframeUri: 'http://localhost:3000/assets/silent-refresh.html', + redirectSilentIframeUri: 'http://localhost:3000/subfolder/assets/silent-refresh.html', redirectUri: '/subfolder', redirectUriLogout: '#/logout', publicUrls: [ @@ -69,7 +69,7 @@ describe('AuthConfigService', () => { secret: '', implicitFlow: true, silentLogin: true, - redirectSilentIframeUri: 'http://localhost:3000/assets/silent-refresh.html', + redirectSilentIframeUri: 'http://localhost:3000/subfolder2/assets/silent-refresh.html', redirectUri: '/subfolder2', redirectUriLogout: '#/logout', publicUrls: [ @@ -135,7 +135,7 @@ describe('AuthConfigService', () => { oidc: true, issuer: 'http://localhost:3000/auth/realms/alfresco', redirectUri: 'http://localhost:3000/#/view/authentication-confirmation/?', - silentRefreshRedirectUri: 'http://localhost:3000/silent-refresh.html', + silentRefreshRedirectUri: 'http://localhost:3000/assets/silent-refresh.html', postLogoutRedirectUri: 'http://localhost:3000/#/logout', clientId: 'fakeClientId', scope: 'openid profile email', @@ -151,7 +151,7 @@ describe('AuthConfigService', () => { oidc: true, issuer: 'http://localhost:3000/auth/realms/alfresco', redirectUri: 'http://localhost:3000/#/view/authentication-confirmation', - silentRefreshRedirectUri: 'http://localhost:3000/silent-refresh.html', + silentRefreshRedirectUri: 'http://localhost:3000/assets/silent-refresh.html', postLogoutRedirectUri: 'http://localhost:3000/#/logout', clientId: 'fakeClientId', scope: 'openid profile email', @@ -182,4 +182,18 @@ describe('AuthConfigService', () => { expect(service.getRedirectUri()).toBe(expectedUri); }); }); + + describe('silentRefreshRedirectUri', () => { + it('should return the silentRefreshRedirectUri with subfolder path', () => { + const expectedUri = 'http://localhost:3000/subfolder/assets/silent-refresh.html'; + spyOnProperty(appConfigService, 'oauth2').and.returnValue(mockAuthConfigSubfolderRedirectUri); + expect(service.loadAppConfig().silentRefreshRedirectUri).toBe(expectedUri); + }); + + it('should return the silentRefreshRedirectUri with subfolder2 path', () => { + const expectedUri = 'http://localhost:3000/subfolder2/assets/silent-refresh.html'; + spyOnProperty(appConfigService, 'oauth2').and.returnValue(mockAuthConfigSubfolder2RedirectUri); + expect(service.loadAppConfig().silentRefreshRedirectUri).toBe(expectedUri); + }); + }); }); diff --git a/lib/core/src/lib/auth/oidc/auth-config.service.ts b/lib/core/src/lib/auth/oidc/auth-config.service.ts index 55e6c5cdbe7..7c2cc8f2d1f 100644 --- a/lib/core/src/lib/auth/oidc/auth-config.service.ts +++ b/lib/core/src/lib/auth/oidc/auth-config.service.ts @@ -58,7 +58,7 @@ export class AuthConfigService { oidc: oauth2.implicitFlow || oauth2.codeFlow || false, issuer: oauth2.host, redirectUri, - silentRefreshRedirectUri: `${origin}/silent-refresh.html`, + silentRefreshRedirectUri: oauth2.redirectSilentIframeUri, postLogoutRedirectUri: `${origin}/${oauth2.redirectUriLogout}`, clientId: oauth2.clientId, scope: oauth2.scope, diff --git a/lib/core/src/lib/layout/components/header/header.component.html b/lib/core/src/lib/layout/components/header/header.component.html index f9dd169ec3e..6e2fc7a4b28 100644 --- a/lib/core/src/lib/layout/components/header/header.component.html +++ b/lib/core/src/lib/layout/components/header/header.component.html @@ -1,7 +1,7 @@ + [style.background-image]="backgroundImage ? 'url(' + backgroundImage + ')' : 'none'">