2019-11-14 13:45:05 +00:00
|
|
|
package org.keycloak.authentication;
|
|
|
|
|
|
|
|
import org.keycloak.models.AuthenticationExecutionModel;
|
2020-01-14 20:54:45 +00:00
|
|
|
import org.keycloak.models.KeycloakSession;
|
2019-11-14 13:45:05 +00:00
|
|
|
|
|
|
|
public class AuthenticationSelectionOption {
|
|
|
|
|
2020-01-14 20:54:45 +00:00
|
|
|
private final KeycloakSession session;
|
|
|
|
private final AuthenticationExecutionModel authExec;
|
2019-11-14 13:45:05 +00:00
|
|
|
|
2020-01-14 20:54:45 +00:00
|
|
|
public AuthenticationSelectionOption(KeycloakSession session, AuthenticationExecutionModel authExec) {
|
|
|
|
this.session = session;
|
2019-11-14 13:45:05 +00:00
|
|
|
this.authExec = authExec;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public AuthenticationExecutionModel getAuthenticationExecution() {
|
|
|
|
return authExec;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getAuthExecId(){
|
|
|
|
return authExec.getId();
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getAuthExecName() {
|
|
|
|
return authExec.getAuthenticator();
|
|
|
|
}
|
|
|
|
|
2020-01-14 20:54:45 +00:00
|
|
|
public String getAuthExecDisplayName() {
|
|
|
|
// TODO: Retrieve the displayName for the authenticator from the AuthenticationFactory
|
|
|
|
// TODO: Retrieve icon CSS style
|
|
|
|
// TODO: Should be addressed as part of https://issues.redhat.com/browse/KEYCLOAK-12185
|
|
|
|
return getAuthExecName();
|
2019-11-14 13:45:05 +00:00
|
|
|
}
|
|
|
|
|
2020-01-14 20:54:45 +00:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
return " authSelection - " + authExec.getAuthenticator();
|
2019-11-14 13:45:05 +00:00
|
|
|
}
|
|
|
|
}
|