All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.unicon.cas.mfa.authentication.DefaultAuthenticationMethodConfigurationProvider Maven / Gradle / Ivy

Go to download

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.

There is a newer version: 2.0.0-RC3
Show newest version
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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy