net.unicon.cas.mfa.authentication.DefaultAuthenticationMethodConfigurationProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cas-mfa-java Show documentation
Show all versions of cas-mfa-java Show documentation
This module is intended to include all the Java you need to add to a CAS implementation
to take advantage of the extended multifactor authentication features in this project.
package net.unicon.cas.mfa.authentication;
import java.util.Map;
/**
* @author Misagh Moayyed
*/
public class DefaultAuthenticationMethodConfigurationProvider implements AuthenticationMethodConfigurationProvider {
private final Map authenticationMethodsMap;
/**
* Instantiates a new Default authentication method configuration provider.
*
* @param authenticationMethodsMap the authentication methods map
*/
public DefaultAuthenticationMethodConfigurationProvider(final Map authenticationMethodsMap) {
this.authenticationMethodsMap = authenticationMethodsMap;
}
@Override
public boolean containsAuthenticationMethod(final String name) {
return getAuthenticationMethod(name) != null;
}
@Override
public AuthenticationMethod getAuthenticationMethod(final String name) {
if (this.authenticationMethodsMap.containsKey(name)) {
final Integer rank = this.authenticationMethodsMap.get(name);
return new AuthenticationMethod(name, rank);
}
return null;
}
}