mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-13 21:13:07 +00:00
50 lines
1.1 KiB
TypeScript
50 lines
1.1 KiB
TypeScript
import { AuthMethodType } from './auth.method-type';
|
|
|
|
export class AuthMethod {
|
|
authMethodType: AuthMethodType;
|
|
position: number;
|
|
location?: string;
|
|
|
|
constructor(authMethodName: string, position: number, location?: string) {
|
|
this.position = position;
|
|
|
|
switch (authMethodName) {
|
|
case 'ip': {
|
|
this.authMethodType = AuthMethodType.Ip;
|
|
break;
|
|
}
|
|
case 'ldap': {
|
|
this.authMethodType = AuthMethodType.Ldap;
|
|
break;
|
|
}
|
|
case 'shibboleth': {
|
|
this.authMethodType = AuthMethodType.Shibboleth;
|
|
this.location = location;
|
|
break;
|
|
}
|
|
case 'x509': {
|
|
this.authMethodType = AuthMethodType.X509;
|
|
break;
|
|
}
|
|
case 'password': {
|
|
this.authMethodType = AuthMethodType.Password;
|
|
break;
|
|
}
|
|
case 'oidc': {
|
|
this.authMethodType = AuthMethodType.Oidc;
|
|
this.location = location;
|
|
break;
|
|
}
|
|
case 'orcid': {
|
|
this.authMethodType = AuthMethodType.Orcid;
|
|
this.location = location;
|
|
break;
|
|
}
|
|
|
|
default: {
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|