net.unicon.cas.mfa.authentication.RequestedAuthenticationMethodRankingStrategy 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 net.unicon.cas.mfa.web.support.MultiFactorAuthenticationSupportingWebApplicationService;
import java.util.Set;
/**
* Strategy interface for ranking requested authentication methods.
*
* @author Dmitriy Kopylenko
* @author Unicon inc.
*/
public interface RequestedAuthenticationMethodRankingStrategy {
/**
* Calculates the highest ranking possible authentication method from the list of the requested ones.
*
* @param mfaTransaction mfa transaction encapsulating possible requested authentication methods
*
* @return mfa service representing the highest possible ranking authentication method or null
* if implementations are unable to perform such calculation
*/
MultiFactorAuthenticationSupportingWebApplicationService computeHighestRankingAuthenticationMethod(
MultiFactorAuthenticationTransactionContext mfaTransaction);
/**
* Determine if provided list of previously achieved authentication methods contains any one method stronger than
* currently requested one. The algorithm and configuration of the ranking strength of the authentication methods
* should be provided by implementations.
*
* @param previouslyAchievedAuthenticationMethods set of previously achieved authentication methods
* @param requestedAuthenticationMethod requestedAuthenticationMethod
*
* @return true if list contains any methods stronger than requested one, and false otherwise
*/
boolean anyPreviouslyAchievedAuthenticationMethodsStrongerThanRequestedOne(Set previouslyAchievedAuthenticationMethods,
String requestedAuthenticationMethod);
}