mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
Removed old shibboleth code
This commit is contained in:
@@ -46,9 +46,6 @@ export interface AuthState {
|
|||||||
// true when refreshing token
|
// true when refreshing token
|
||||||
refreshing?: boolean;
|
refreshing?: boolean;
|
||||||
|
|
||||||
// sso login url
|
|
||||||
ssoLoginUrl?: string;
|
|
||||||
|
|
||||||
// the authenticated user
|
// the authenticated user
|
||||||
user?: EPerson;
|
user?: EPerson;
|
||||||
|
|
||||||
|
@@ -230,30 +230,14 @@ export class AuthService {
|
|||||||
map((status: AuthStatus) => {
|
map((status: AuthStatus) => {
|
||||||
let authMethods: AuthMethodModel[];
|
let authMethods: AuthMethodModel[];
|
||||||
if (isNotEmpty(status.authMethods)) {
|
if (isNotEmpty(status.authMethods)) {
|
||||||
// url = this.parseSSOLocation(status.ssoLoginUrl);
|
authMethods = status.authMethods;
|
||||||
// console.log('Parsed SSOLoginUrl: ', url);
|
|
||||||
// url = 'https://fis.tiss.tuwien.ac.at/Shibboleth.sso/Login?target=https://fis.tiss.tuwien.ac.at';
|
|
||||||
authMethods = status.authMethods;
|
|
||||||
}
|
}
|
||||||
return authMethods;
|
return authMethods;
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* private parseSSOLocation(url: string): string {
|
|
||||||
console.log('auth.service parseSSOLocation was called');
|
|
||||||
const parseUrl = decodeURIComponent(url);
|
|
||||||
// const urlTree: UrlTree = this.router.parseUrl(url);
|
|
||||||
// this.router.parseUrl(url);
|
|
||||||
// if (url.endsWith('/')) {
|
|
||||||
// url += 'login';
|
|
||||||
// } else {
|
|
||||||
// url = url.replace('/?target=http(.+)/g', 'https://hasselt-dspace.dev01.4science.it/dspace-spring-rest/shib.html');
|
|
||||||
// }
|
|
||||||
// console.log(url);
|
|
||||||
const target = `?target=${this.config.auth.target.host}${this.config.auth.target.page}`;
|
|
||||||
return parseUrl.replace(/\?target=http.+/g, target);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new user
|
* Create a new user
|
||||||
|
@@ -107,13 +107,6 @@ const _getRegistrationError = (state: AuthState) => state.error;
|
|||||||
*/
|
*/
|
||||||
const _getRedirectUrl = (state: AuthState) => state.redirectUrl;
|
const _getRedirectUrl = (state: AuthState) => state.redirectUrl;
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the sso login url.
|
|
||||||
* @function _getSSOLoginUrl
|
|
||||||
* @param {State} state
|
|
||||||
* @returns {string}
|
|
||||||
*/
|
|
||||||
const _getSSOLoginUrl = (state: AuthState) => state.ssoLoginUrl;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the authenticated user
|
* Returns the authenticated user
|
||||||
@@ -212,12 +205,3 @@ export const getRegistrationError = createSelector(getAuthState, _getRegistratio
|
|||||||
* @return {string}
|
* @return {string}
|
||||||
*/
|
*/
|
||||||
export const getRedirectUrl = createSelector(getAuthState, _getRedirectUrl);
|
export const getRedirectUrl = createSelector(getAuthState, _getRedirectUrl);
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the sso login url.
|
|
||||||
* @function getSSOLoginUrl
|
|
||||||
* @param {AuthState} state
|
|
||||||
* @param {any} props
|
|
||||||
* @return {string}
|
|
||||||
*/
|
|
||||||
export const getSSOLoginUrl = createSelector(getAuthState, _getSSOLoginUrl);
|
|
||||||
|
@@ -27,11 +27,13 @@
|
|||||||
[disabled]="!form.valid">{{"login.form.submit" | translate}}</button>
|
[disabled]="!form.valid">{{"login.form.submit" | translate}}</button>
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
<!--
|
||||||
<div *ngIf="(hasSsoLoginUrl | async)">
|
<div *ngIf="(hasSsoLoginUrl | async)">
|
||||||
<!--<div class="text-center mt-2"><span class="align-middle">{{"login.form.or-divider" | translate}}</span></div>-->
|
<!–<div class="text-center mt-2"><span class="align-middle">{{"login.form.or-divider" | translate}}</span></div>–>
|
||||||
<a class="btn btn-lg btn-primary btn-block mt-2" [href]="(ssoLoginUrl | async)"
|
<a class="btn btn-lg btn-primary btn-block mt-2" [href]="(ssoLoginUrl | async)"
|
||||||
role="button">{{"login.form.ssoLogin" | translate}}</a>
|
role="button">{{"login.form.ssoLogin" | translate}}</a>
|
||||||
</div>
|
</div>-->
|
||||||
|
|
||||||
|
|
||||||
<!--Change href to "https://dspace.hostname/Shibboleth.sso/Login?target=https://dspace.hostname/shibboleth"
|
<!--Change href to "https://dspace.hostname/Shibboleth.sso/Login?target=https://dspace.hostname/shibboleth"
|
||||||
|
@@ -11,7 +11,7 @@ import {
|
|||||||
|
|
||||||
import {
|
import {
|
||||||
getAuthenticationError,
|
getAuthenticationError,
|
||||||
getAuthenticationInfo, getSSOLoginUrl,
|
getAuthenticationInfo,
|
||||||
isAuthenticated,
|
isAuthenticated,
|
||||||
isAuthenticationLoading,
|
isAuthenticationLoading,
|
||||||
} from '../../core/auth/selectors';
|
} from '../../core/auth/selectors';
|
||||||
@@ -81,18 +81,6 @@ export class LogInComponent implements OnDestroy, OnInit {
|
|||||||
*/
|
*/
|
||||||
private alive = true;
|
private alive = true;
|
||||||
|
|
||||||
/**
|
|
||||||
* The redirect url to login with sso.
|
|
||||||
* @type {Observable<string>}
|
|
||||||
*/
|
|
||||||
public ssoLoginUrl: Observable<string>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* True if is present the url to login with sso.
|
|
||||||
* @type {Observable<boolean>}
|
|
||||||
*/
|
|
||||||
public hasSsoLoginUrl: Observable<boolean>;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
* @param {AuthService} authService
|
* @param {AuthService} authService
|
||||||
@@ -143,10 +131,6 @@ export class LogInComponent implements OnDestroy, OnInit {
|
|||||||
// set loading
|
// set loading
|
||||||
this.loading = this.store.pipe(select(isAuthenticationLoading));
|
this.loading = this.store.pipe(select(isAuthenticationLoading));
|
||||||
|
|
||||||
// set sso login url
|
|
||||||
this.ssoLoginUrl = this.store.pipe(select(getSSOLoginUrl));
|
|
||||||
this.ssoLoginUrl.subscribe((url) => console.log('url after store select: ', url));
|
|
||||||
|
|
||||||
// subscribe to success
|
// subscribe to success
|
||||||
this.store.pipe(
|
this.store.pipe(
|
||||||
select(isAuthenticated),
|
select(isAuthenticated),
|
||||||
@@ -157,10 +141,6 @@ export class LogInComponent implements OnDestroy, OnInit {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
this.hasSsoLoginUrl = this.ssoLoginUrl
|
|
||||||
.pipe(
|
|
||||||
tap((url) => console.log('url in ngOnInit(): ', url)),
|
|
||||||
map((url) => isNotEmpty(url)))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user