diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index e1ddc2b889..14bf3ef35e 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -3,6 +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/shibbolethTargetPage/shibboleth.component'; const ITEM_MODULE_PATH = 'items'; export function getItemModulePath() { @@ -39,6 +40,7 @@ export function getAdminModulePath() { { path: 'submit', loadChildren: './+submit-page/submit-page.module#SubmitPageModule' }, { path: 'workspaceitems', loadChildren: './+workspaceitems-edit-page/workspaceitems-edit-page.module#WorkspaceitemsEditPageModule' }, { path: 'workflowitems', loadChildren: './+workflowitems-edit-page/workflowitems-edit-page.module#WorkflowItemsEditPageModule' }, + { path: 'shibboleth', pathMatch: 'full', component: ShibbolethComponent }, { path: '**', pathMatch: 'full', component: PageNotFoundComponent }, ]) ], diff --git a/src/app/core/auth/auth.effects.ts b/src/app/core/auth/auth.effects.ts index 8665ef2e08..1f9c0df1bf 100644 --- a/src/app/core/auth/auth.effects.ts +++ b/src/app/core/auth/auth.effects.ts @@ -58,11 +58,10 @@ export class AuthEffects { }) ); - /** +/* /!** * Authenticate user. * @method authenticate - */ -/* + *!/ @Effect() public shibbolethAuthenticate$: Observable = this.actions$.pipe( ofType(AuthActionTypes.START_SHIBBOLETH_AUTHENTICATION), @@ -73,8 +72,7 @@ export class AuthEffects { catchError((error) => observableOf(new AuthenticationErrorAction(error))) ); }) - ); -*/ + );*/ /** * Shib Login. diff --git a/src/app/core/auth/auth.interceptor.ts b/src/app/core/auth/auth.interceptor.ts index 19b47f71f3..405268cd62 100644 --- a/src/app/core/auth/auth.interceptor.ts +++ b/src/app/core/auth/auth.interceptor.ts @@ -106,7 +106,7 @@ export class AuthInterceptor implements HttpInterceptor { return authMethodModels; } - private makeAuthStatusObject(authenticated: boolean, accessToken?: string, error?: string, httpHeaders?: HttpHeaders,): AuthStatus { + private makeAuthStatusObject(authenticated: boolean, accessToken?: string, error?: string, httpHeaders?: HttpHeaders): AuthStatus { const authStatus = new AuthStatus(); // let authMethods: AuthMethodModel[]; if (httpHeaders) { diff --git a/src/app/core/auth/models/auth-method.model.ts b/src/app/core/auth/models/auth-method.model.ts index dd68cc5162..3b6fe38d3a 100644 --- a/src/app/core/auth/models/auth-method.model.ts +++ b/src/app/core/auth/models/auth-method.model.ts @@ -1,4 +1,4 @@ -import {AuthMethodType} from '../../../shared/log-in/authMethods-type'; +import {AuthMethodType} from '../../../shared/log-in/methods/authMethods-type'; export class AuthMethodModel { authMethodType: AuthMethodType; diff --git a/src/app/shared/log-in/container/login-container.component.ts b/src/app/shared/log-in/container/login-container.component.ts index a4e04bfb76..2abaeb04c3 100644 --- a/src/app/shared/log-in/container/login-container.component.ts +++ b/src/app/shared/log-in/container/login-container.component.ts @@ -1,5 +1,5 @@ import { Component, ContentChild, Injector, Input, OnInit, ViewChild, ViewChildren } from '@angular/core'; -import { rendersAuthMethodType } from '../authMethods-decorator'; +import { rendersAuthMethodType } from '../methods/authMethods-decorator'; import { AuthMethodModel } from '../../../core/auth/models/auth-method.model'; import { select, Store } from '@ngrx/store'; import { CoreState } from '../../../core/core.reducers'; diff --git a/src/app/shared/log-in/authMethods.component.html b/src/app/shared/log-in/log-in.component.html similarity index 100% rename from src/app/shared/log-in/authMethods.component.html rename to src/app/shared/log-in/log-in.component.html diff --git a/src/app/shared/log-in/authMethods.component.scss b/src/app/shared/log-in/log-in.component.scss similarity index 100% rename from src/app/shared/log-in/authMethods.component.scss rename to src/app/shared/log-in/log-in.component.scss diff --git a/src/app/shared/log-in/authMethods.component.ts b/src/app/shared/log-in/log-in.component.ts similarity index 81% rename from src/app/shared/log-in/authMethods.component.ts rename to src/app/shared/log-in/log-in.component.ts index 5a42cb73a7..e800718db0 100644 --- a/src/app/shared/log-in/authMethods.component.ts +++ b/src/app/shared/log-in/log-in.component.ts @@ -7,10 +7,10 @@ import { CoreState } from '../../core/core.reducers'; @Component({ selector: 'ds-auth-methods', - templateUrl: './authMethods.component.html', - styleUrls: ['./authMethods.component.scss'] + templateUrl: './log-in.component.html', + styleUrls: ['./log-in.component.scss'] }) -export class AuthMethodsComponent implements OnInit { +export class LogInComponent implements OnInit { /** * The authentication methods data * @type {AuthMethodModel[]} @@ -33,7 +33,7 @@ export class AuthMethodsComponent implements OnInit { } ngOnInit(): void { - this.authMethodData = this.authMethodData = this.store.select(getAuthenticationMethods); + this.authMethodData = this.store.pipe(select(getAuthenticationMethods)); // set loading this.loading = this.store.pipe(select(isAuthenticationLoading)); diff --git a/src/app/shared/log-in/authMethods-decorator.ts b/src/app/shared/log-in/methods/authMethods-decorator.ts similarity index 100% rename from src/app/shared/log-in/authMethods-decorator.ts rename to src/app/shared/log-in/methods/authMethods-decorator.ts diff --git a/src/app/shared/log-in/authMethods-type.ts b/src/app/shared/log-in/methods/authMethods-type.ts similarity index 100% rename from src/app/shared/log-in/authMethods-type.ts rename to src/app/shared/log-in/methods/authMethods-type.ts diff --git a/src/app/shared/log-in/methods/password/log-in-password.component.ts b/src/app/shared/log-in/methods/password/log-in-password.component.ts index b312a0ce1d..e993fc5606 100644 --- a/src/app/shared/log-in/methods/password/log-in-password.component.ts +++ b/src/app/shared/log-in/methods/password/log-in-password.component.ts @@ -20,8 +20,8 @@ import { CoreState } from '../../../../core/core.reducers'; import { isNotEmpty } from '../../../empty.util'; import { fadeOut } from '../../../animations/fade'; import { AuthService } from '../../../../core/auth/auth.service'; -import { AuthMethodType } from '../../authMethods-type'; -import { renderAuthMethodFor } from '../../authMethods-decorator'; +import { AuthMethodType } from '../authMethods-type'; +import { renderAuthMethodFor } from '../authMethods-decorator'; /** * /users/sign-in diff --git a/src/app/shared/log-in/methods/shibboleth/dynamic-shibboleth.component.html b/src/app/shared/log-in/methods/shibboleth/dynamic-shibboleth.component.html index 5010291891..9daa39527c 100644 --- a/src/app/shared/log-in/methods/shibboleth/dynamic-shibboleth.component.html +++ b/src/app/shared/log-in/methods/shibboleth/dynamic-shibboleth.component.html @@ -3,9 +3,17 @@ - - + + diff --git a/src/app/shared/log-in/methods/shibboleth/dynamic-shibboleth.component.ts b/src/app/shared/log-in/methods/shibboleth/dynamic-shibboleth.component.ts index 6c65f0b14b..3ee2709123 100644 --- a/src/app/shared/log-in/methods/shibboleth/dynamic-shibboleth.component.ts +++ b/src/app/shared/log-in/methods/shibboleth/dynamic-shibboleth.component.ts @@ -1,8 +1,8 @@ import { Component, EventEmitter, Inject, Input, OnInit, Output, QueryList, ViewChildren } from '@angular/core'; -import { renderAuthMethodFor } from '../../authMethods-decorator'; -import { AuthMethodType } from '../../authMethods-type'; +import { renderAuthMethodFor } from '../authMethods-decorator'; +import { AuthMethodType } from '../authMethods-type'; import { AuthMethodModel } from '../../../../core/auth/models/auth-method.model'; -import { FormBuilder, FormGroup } from '@angular/forms'; +import { FormBuilder, FormControl, FormGroup } from '@angular/forms'; import { select, Store } from '@ngrx/store'; import { CoreState } from '../../../../core/core.reducers'; import { StartShibbolethAuthenticationAction } from '../../../../core/auth/auth.actions'; @@ -42,6 +42,8 @@ export class DynamicShibbolethComponent implements OnInit { private host: string; + // public shibbButton: FormControl; + /** * @constructor */ @@ -63,6 +65,8 @@ export class DynamicShibbolethComponent implements OnInit { shibbButton: [''], }); + // this.shibbButton = new FormControl(''); + // set isAuthenticated this.isAuthenticated = this.store.pipe(select(isAuthenticated)); diff --git a/src/app/shared/shared.module.ts b/src/app/shared/shared.module.ts index 89cceee70d..5b8e54c31b 100644 --- a/src/app/shared/shared.module.ts +++ b/src/app/shared/shared.module.ts @@ -141,7 +141,7 @@ import {DynamicShibbolethComponent} from './log-in/methods/shibboleth/dynamic-sh // import {LogInComponent} from './log-in/log-in.component'; import {LogInPasswordComponent} from './log-in/methods/password/log-in-password.component'; import { LoginContainerComponent } from './log-in/container/login-container.component'; -import { AuthMethodsComponent } from './log-in/authMethods.component'; +import { LogInComponent } from './log-in/log-in.component'; const MODULES = [ // Do NOT include UniversalModule, HttpModule, or JsonpModule here @@ -266,7 +266,7 @@ const COMPONENTS = [ DynamicShibbolethComponent, LogInPasswordComponent, LoginContainerComponent, - AuthMethodsComponent + LogInComponent ]; const ENTRY_COMPONENTS = [