From 99576dc64acffe88c5d6be4d4659e8c07d7ce01d Mon Sep 17 00:00:00 2001 From: Julius Gruber Date: Thu, 6 Jun 2019 14:29:46 +0200 Subject: [PATCH] Hardcoded ssoLoginUrl in auth.service retrieveAuthMethods --- config/environment.default.js | 2 +- src/app/core/auth/auth.interceptor.ts | 4 ++-- src/app/core/auth/auth.service.ts | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/config/environment.default.js b/config/environment.default.js index f13cbcfc74..221b2e8ef9 100644 --- a/config/environment.default.js +++ b/config/environment.default.js @@ -33,7 +33,7 @@ module.exports = { auth: { target: { host: 'https://fis.tiss.tuwien.ac.at', - page: '/spring-rest/login.html' + page: '' } }, // Form settings diff --git a/src/app/core/auth/auth.interceptor.ts b/src/app/core/auth/auth.interceptor.ts index d9697d3f20..6114af7e24 100644 --- a/src/app/core/auth/auth.interceptor.ts +++ b/src/app/core/auth/auth.interceptor.ts @@ -77,7 +77,7 @@ export class AuthInterceptor implements HttpInterceptor { return authStatus; } - private getLocationfromHeader(header: HttpHeaders): string { + private getSSOLocationfromHeader(header: HttpHeaders): string { console.log('HEADER www-authenticate: ', header.get('www-authenticate')); let location = ''; if (header.get('www-authenticate').startsWith('shibboleth realm')) { @@ -164,7 +164,7 @@ export class AuthInterceptor implements HttpInterceptor { // console.log('error: ', error); let location = ''; if (error.headers.get('www-authenticate') != null) { - location = this.getLocationfromHeader(error.headers); + location = this.getSSOLocationfromHeader(error.headers); } // Create a new HttpResponse and return it, so it can be handle properly by AuthService. const authResponse = new HttpResponse({ diff --git a/src/app/core/auth/auth.service.ts b/src/app/core/auth/auth.service.ts index 9a2c1a9f1b..f0e53a3e07 100644 --- a/src/app/core/auth/auth.service.ts +++ b/src/app/core/auth/auth.service.ts @@ -209,7 +209,9 @@ export class AuthService { let url = ''; if (isNotEmpty(status.ssoLoginUrl)) { // url = this.parseSSOLocation(status.ssoLoginUrl); - url = 'https://fis.tiss.tuwien.ac.at/Shibboleth.sso/Login?target=https://fis.tiss.tuwien.ac.at'; + // console.log('Parsed SSOLoginUrl: ', url); + url = 'https://fis.tiss.tuwien.ac.at/Shibboleth.sso/Login?target=https://fis.tiss.tuwien.ac.at'; + // url = status.ssoLoginUrl; } return url; })