Files
dspace-angular/src/app/core/auth/models/auth-method.model.ts
2019-08-08 09:29:00 +02:00

45 lines
956 B
TypeScript

export class AuthMethodModel {
authMethodName: string;
location?: string;
authMethodConstant: AuthMethodConstants
constructor(authMethodName: string, location?: string) {
this.authMethodName = authMethodName;
this.location = location;
switch (authMethodName) {
case 'ip': {
this.authMethodConstant = AuthMethodConstants.IP;
break;
}
case 'ldap': {
this.authMethodConstant = AuthMethodConstants.LDAP;
break;
}
case 'shibboleth': {
this.authMethodConstant = AuthMethodConstants.SHIBBOLETH;
break;
}
case 'x509': {
this.authMethodConstant = AuthMethodConstants.X509;
break;
}
case 'password': {
this.authMethodConstant = AuthMethodConstants.PASSWORD;
break;
}
default: {
break;
}
}
}
}
export enum AuthMethodConstants {
IP,
LDAP,
SHIBBOLETH,
X509,
PASSWORD,
}