diff --git a/resources/i18n/en.json b/resources/i18n/en.json index 1ae27630a1..deed067d43 100644 --- a/resources/i18n/en.json +++ b/resources/i18n/en.json @@ -399,7 +399,6 @@ "volume-title": "Volume Title", "publisher": "Publisher", "description": "Description" - }, "listelement": { "badge": "Publication" @@ -924,14 +923,14 @@ }, "login": { "title": "Login", + "shibboleth": "Shibboleth", "form": { "header": "Please log in to DSpace", "email": "Email address", "forgot-password": "Have you forgotten your password?", "new-user": "New user? Click here to register.", "password": "Password", - "submit": "Log in", - "ssoLogin": "Shibboleth" + "submit": "Log in" } }, "logout": { diff --git a/src/app/+login-page/login-page-routing.module.ts b/src/app/+login-page/login-page-routing.module.ts index 6a7520fae1..d3c6425dd3 100644 --- a/src/app/+login-page/login-page-routing.module.ts +++ b/src/app/+login-page/login-page-routing.module.ts @@ -2,13 +2,11 @@ import { NgModule } from '@angular/core'; import { RouterModule } from '@angular/router'; import { LoginPageComponent } from './login-page.component'; -import {ShibbolethComponent} from './shibboleth/shibboleth.component'; @NgModule({ imports: [ RouterModule.forChild([ { path: '', pathMatch: 'full', component: LoginPageComponent, data: { title: 'login.title' } } - /* { path: 'shibboleth', component: ShibbolethComponent }*/ ]) ] }) diff --git a/src/app/+login-page/login-page.module.ts b/src/app/+login-page/login-page.module.ts index bd4c0a9a43..65cbd26c04 100644 --- a/src/app/+login-page/login-page.module.ts +++ b/src/app/+login-page/login-page.module.ts @@ -4,7 +4,6 @@ import { SharedModule } from '../shared/shared.module'; import { LoginPageComponent } from './login-page.component'; import { LoginPageRoutingModule } from './login-page-routing.module'; - @NgModule({ imports: [ LoginPageRoutingModule, diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 9611e98325..d1d27918c3 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -3,7 +3,7 @@ import {RouterModule} from '@angular/router'; import {PageNotFoundComponent} from './pagenotfound/pagenotfound.component'; import {AuthenticatedGuard} from './core/auth/authenticated.guard'; -import {ShibbolethComponent} from './+login-page/shibboleth/shibboleth.component'; +import {ShibbolethComponent} from './+login-page/shibbolethTargetPage/shibboleth.component'; const ITEM_MODULE_PATH = 'items'; diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 30520eb364..817e8d0a79 100755 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -39,7 +39,7 @@ import { ExpandableAdminSidebarSectionComponent } from './+admin/admin-sidebar/e import { NavbarModule } from './navbar/navbar.module'; import { JournalEntitiesModule } from './entity-groups/journal-entities/journal-entities.module'; import { ResearchEntitiesModule } from './entity-groups/research-entities/research-entities.module'; -import { ShibbolethComponent } from './+login-page/shibboleth/shibboleth.component'; +import { ShibbolethComponent } from './+login-page/shibbolethTargetPage/shibboleth.component'; export function getConfig() { return ENV_CONFIG; diff --git a/src/app/core/auth/auth-request.service.ts b/src/app/core/auth/auth-request.service.ts index 23c767c61b..728546959a 100644 --- a/src/app/core/auth/auth-request.service.ts +++ b/src/app/core/auth/auth-request.service.ts @@ -43,9 +43,7 @@ export class AuthRequestService { public postToEndpoint(method: string, body?: any, options?: HttpOptions): Observable { return this.halService.getEndpoint(this.linkName).pipe( filter((href: string) => isNotEmpty(href)), - tap((href: string) => console.log('This is href in postToEndpoint(): ' , href)), map((endpointURL) => this.getEndpointByMethod(endpointURL, method)), - tap((href2) => {console.log('href2', href2)}), distinctUntilChanged(), map((endpointURL: string) => new AuthPostRequest(this.requestService.generateRequestId(), endpointURL, body, options)), tap((request: PostRequest) => this.requestService.configure(request, true)), @@ -57,9 +55,7 @@ export class AuthRequestService { console.log('auth.request getRequest() was called'); return this.halService.getEndpoint(this.linkName).pipe( filter((href: string) => isNotEmpty(href)), - tap((href) => console.log('auth-request.service getRequest()', href)), map((endpointURL) => this.getEndpointByMethod(endpointURL, method)), - tap((whatsThis) => console.log('whatsThis: ', whatsThis)), distinctUntilChanged(), map((endpointURL: string) => new AuthGetRequest(this.requestService.generateRequestId(), endpointURL, options)), tap((request: GetRequest) => this.requestService.configure(request, true)), diff --git a/src/app/core/auth/auth.interceptor.ts b/src/app/core/auth/auth.interceptor.ts index 0e321573d9..fd2d029cd4 100644 --- a/src/app/core/auth/auth.interceptor.ts +++ b/src/app/core/auth/auth.interceptor.ts @@ -74,10 +74,8 @@ export class AuthInterceptor implements HttpInterceptor { } private parseAuthMethodsfromHeaders(headers: HttpHeaders): AuthMethodModel[] { - // console.log('parseAuthMethodsfromHeaders(): ', headers); const authMethodModels: AuthMethodModel[] = []; const parts: string[] = headers.get('www-authenticate').split(','); - console.log('parts: ', parts); // get the login methods names // tslint:disable-next-line:forin for (const i in parts) { @@ -89,14 +87,15 @@ export class AuthInterceptor implements HttpInterceptor { // if so the next part is the shibboleth location // e.g part i: shibboleth realm="DSpace REST API", part i+1: location="/Shibboleth.sso/Login?target=https://serverUrl" if (methodName.includes('shibboleth')) { - const location: string = this.parseShibbolethLocation(parts[+i + 1]); // +1: unaray + operator is necessaray because i is a string, the operator works like parseInt() - // console.log('shib location: ', location); + // +1: unaray + operator in the next line is necessaray because i is a string, the operator works like parseInt() + const location: string = this.parseShibbolethLocation(parts[+i + 1]); authMethod.location = location; } + // if other authentication methods deliver data needed for the method to work + // it would be checked here e.g. if (methodName.includes('ldap')) { } authMethodModels.push(authMethod); } } - // console.log('Array of AuthMethodModels: ', authMethodModels); return authMethodModels; } @@ -183,13 +182,11 @@ export class AuthInterceptor implements HttpInterceptor { } }), catchError((error, caught) => { - console.log('catchError operator in auth.interceptor was triggered'); // Intercept an error response if (error instanceof HttpErrorResponse) { // Checks if is a response from a request to an authentication endpoint if (this.isAuthRequest(error)) { - console.log('catchError isAuthRequest=true'); // clean eventually refresh Requests list this.refreshTokenRequestUrls = []; diff --git a/src/app/core/auth/auth.reducer.ts b/src/app/core/auth/auth.reducer.ts index be1aa134fc..2ce8896b62 100644 --- a/src/app/core/auth/auth.reducer.ts +++ b/src/app/core/auth/auth.reducer.ts @@ -12,8 +12,8 @@ import { SetRedirectUrlAction } from './auth.actions'; // import models -import { EPerson } from '../eperson/models/eperson.model'; -import { AuthTokenInfo } from './models/auth-token-info.model'; +import {EPerson} from '../eperson/models/eperson.model'; +import {AuthTokenInfo} from './models/auth-token-info.model'; import {AuthMethodModel} from './models/auth-method.model'; /** @@ -200,15 +200,13 @@ export function authReducer(state: any = initialState, action: AuthActions): Aut info: undefined, }); - // next three cases are used by shibboleth login + // next three cases are used by dynamic rendering of login methods case AuthActionTypes.RETRIEVE_AUTH_METHODS: - console.log('case AuthActionTypes.RETRIEVE_AUTH_METHODS'); return Object.assign({}, state, { loading: true }); case AuthActionTypes.RETRIEVE_AUTH_METHODS_SUCCESS: - console.log('case RETRIEVE_AUTH_METHODS_SUCCESS'); return Object.assign({}, state, { loading: false, authMethods: (action as RetrieveAuthMethodsSuccessAction).payload diff --git a/src/app/core/auth/auth.service.ts b/src/app/core/auth/auth.service.ts index e0aecd91a0..1084a384de 100644 --- a/src/app/core/auth/auth.service.ts +++ b/src/app/core/auth/auth.service.ts @@ -224,8 +224,6 @@ export class AuthService { * @returns {User} */ public retrieveAuthMethods(): Observable { - console.log('auth.service retrieveAuthMethods() was called'); - // return this.authRequestService.getRequest('login').pipe( return this.authRequestService.postToEndpoint('login', {}).pipe( map((status: AuthStatus) => { let authMethods: AuthMethodModel[]; @@ -237,8 +235,6 @@ export class AuthService { ) } - - /** * Create a new user * @returns {User} diff --git a/src/app/shared/log-in/password/log-in.component.html b/src/app/shared/log-in/password/log-in.component.html index 139ffd276e..e1dc72857e 100644 --- a/src/app/shared/log-in/password/log-in.component.html +++ b/src/app/shared/log-in/password/log-in.component.html @@ -26,33 +26,6 @@ -
- - - - - - - - - - - - {{"login.form.new-user" | translate}} diff --git a/src/app/shared/log-in/shibboleth/dynamic-shibboleth.component.html b/src/app/shared/log-in/shibboleth/dynamic-shibboleth.component.html index 92a03b1daf..ee92610120 100644 --- a/src/app/shared/log-in/shibboleth/dynamic-shibboleth.component.html +++ b/src/app/shared/log-in/shibboleth/dynamic-shibboleth.component.html @@ -1,22 +1,8 @@ - - - - -
Shibboleth + >{{"login.shibboleth" | translate}}