Package org.apereo.cas.authentication
Class MultifactorAuthenticationUtils
java.lang.Object
org.apereo.cas.authentication.MultifactorAuthenticationUtils
This is
MultifactorAuthenticationUtils.- Since:
- 5.2.0
-
Method Summary
Modifier and TypeMethodDescriptionbuildEventAttributeMap(org.apereo.cas.authentication.principal.Principal principal, Optional<org.apereo.cas.authentication.principal.Service> service, Optional<org.apereo.cas.services.RegisteredService> registeredService, org.apereo.cas.authentication.MultifactorAuthenticationProvider provider) Build event attribute map.static Set<org.springframework.webflow.execution.Event> evaluateEventForProviderInContext(org.apereo.cas.authentication.principal.Principal principal, org.apereo.cas.services.RegisteredService registeredService, org.apereo.cas.authentication.principal.Service service, Optional<org.springframework.webflow.execution.RequestContext> context, org.apereo.cas.authentication.MultifactorAuthenticationProvider provider) Evaluate event for provider in context set.getAvailableMultifactorAuthenticationProviders(org.springframework.context.ApplicationContext applicationContext) Gets all multifactor authentication providers from application context.static Optional<org.apereo.cas.authentication.MultifactorAuthenticationProvider> getMultifactorAuthenticationProviderById(String providerId, org.springframework.context.ApplicationContext context) Method returns an Optional that will contain aMultifactorAuthenticationProviderthat has the same id as the passed providerId parameter.static Collection<org.apereo.cas.authentication.MultifactorAuthenticationProvider> getMultifactorAuthenticationProviderForService(org.apereo.cas.services.RegisteredService service, org.springframework.context.ApplicationContext applicationContext) Gets authentication provider for service.static Optional<org.apereo.cas.authentication.MultifactorAuthenticationProvider> getMultifactorAuthenticationProviderFromApplicationContext(String providerId, org.springframework.context.ApplicationContext applicationContext) Gets multifactor authentication provider from application context.static Set<org.springframework.webflow.execution.Event> resolveEventViaMultivaluedAttribute(org.apereo.cas.authentication.principal.Principal principal, Object attributeValue, org.apereo.cas.services.RegisteredService registeredService, org.apereo.cas.authentication.principal.Service service, Optional<org.springframework.webflow.execution.RequestContext> context, org.apereo.cas.authentication.MultifactorAuthenticationProvider provider, BiPredicate<String, org.apereo.cas.authentication.MultifactorAuthenticationProvider> predicate) Resolve event via multivalued attribute set.static Set<org.springframework.webflow.execution.Event> resolveEventViaSingleAttribute(org.apereo.cas.authentication.principal.Principal principal, Object providedAttributeValue, org.apereo.cas.services.RegisteredService registeredService, org.apereo.cas.authentication.principal.Service service, Optional<org.springframework.webflow.execution.RequestContext> context, org.apereo.cas.authentication.MultifactorAuthenticationProvider provider, BiPredicate<String, org.apereo.cas.authentication.MultifactorAuthenticationProvider> predicate) Resolve event via single attribute set.static Optional<org.apereo.cas.authentication.MultifactorAuthenticationProvider> resolveProvider(Map<String, org.apereo.cas.authentication.MultifactorAuthenticationProvider> providers, String requestMfaMethod) Resolve provider optional.static Optional<org.apereo.cas.authentication.MultifactorAuthenticationProvider> resolveProvider(Map<String, org.apereo.cas.authentication.MultifactorAuthenticationProvider> providers, Collection<String> requestMfaMethod) Resolve provider optional.static org.springframework.webflow.execution.EventvalidateEventIdForMatchingTransitionInContext(String eventId, Optional<org.springframework.webflow.execution.RequestContext> context, Map<String, Object> attributes) Validate event id for matching transition in context event.
-
Method Details
-
buildEventAttributeMap
public static Map<String,Object> buildEventAttributeMap(org.apereo.cas.authentication.principal.Principal principal, Optional<org.apereo.cas.authentication.principal.Service> service, Optional<org.apereo.cas.services.RegisteredService> registeredService, org.apereo.cas.authentication.MultifactorAuthenticationProvider provider) Build event attribute map.- Parameters:
principal- the principalservice- the serviceregisteredService- the serviceprovider- the provider- Returns:
- the map
-
validateEventIdForMatchingTransitionInContext
public static org.springframework.webflow.execution.Event validateEventIdForMatchingTransitionInContext(String eventId, Optional<org.springframework.webflow.execution.RequestContext> context, Map<String, Object> attributes) Validate event id for matching transition in context event.- Parameters:
eventId- the event idcontext- the contextattributes- the attributes- Returns:
- the event
-
resolveEventViaMultivaluedAttribute
public static Set<org.springframework.webflow.execution.Event> resolveEventViaMultivaluedAttribute(org.apereo.cas.authentication.principal.Principal principal, Object attributeValue, org.apereo.cas.services.RegisteredService registeredService, org.apereo.cas.authentication.principal.Service service, Optional<org.springframework.webflow.execution.RequestContext> context, org.apereo.cas.authentication.MultifactorAuthenticationProvider provider, BiPredicate<String, org.apereo.cas.authentication.MultifactorAuthenticationProvider> predicate) Resolve event via multivalued attribute set.- Parameters:
principal- the principalattributeValue- the attribute valueregisteredService- the serviceservice- the servicecontext- the contextprovider- the providerpredicate- the predicate- Returns:
- the set
-
resolveProvider
public static Optional<org.apereo.cas.authentication.MultifactorAuthenticationProvider> resolveProvider(Map<String, org.apereo.cas.authentication.MultifactorAuthenticationProvider> providers, Collection<String> requestMfaMethod) Resolve provider optional.- Parameters:
providers- the providersrequestMfaMethod- the request mfa method- Returns:
- the optional
-
resolveProvider
public static Optional<org.apereo.cas.authentication.MultifactorAuthenticationProvider> resolveProvider(Map<String, org.apereo.cas.authentication.MultifactorAuthenticationProvider> providers, String requestMfaMethod) Resolve provider optional.- Parameters:
providers- the providersrequestMfaMethod- the request mfa method- Returns:
- the optional
-
resolveEventViaSingleAttribute
public static Set<org.springframework.webflow.execution.Event> resolveEventViaSingleAttribute(org.apereo.cas.authentication.principal.Principal principal, Object providedAttributeValue, org.apereo.cas.services.RegisteredService registeredService, org.apereo.cas.authentication.principal.Service service, Optional<org.springframework.webflow.execution.RequestContext> context, org.apereo.cas.authentication.MultifactorAuthenticationProvider provider, BiPredicate<String, org.apereo.cas.authentication.MultifactorAuthenticationProvider> predicate) Resolve event via single attribute set.- Parameters:
principal- the principalprovidedAttributeValue- the attribute valueregisteredService- the serviceservice- the servicecontext- the contextprovider- the providerpredicate- the predicate- Returns:
- the set
-
getMultifactorAuthenticationProviderForService
public static Collection<org.apereo.cas.authentication.MultifactorAuthenticationProvider> getMultifactorAuthenticationProviderForService(org.apereo.cas.services.RegisteredService service, org.springframework.context.ApplicationContext applicationContext) Gets authentication provider for service.- Parameters:
service- the serviceapplicationContext- the application context- Returns:
- the authentication provider for service
-
getMultifactorAuthenticationProviderFromApplicationContext
public static Optional<org.apereo.cas.authentication.MultifactorAuthenticationProvider> getMultifactorAuthenticationProviderFromApplicationContext(String providerId, org.springframework.context.ApplicationContext applicationContext) Gets multifactor authentication provider from application context.- Parameters:
providerId- the provider idapplicationContext- the application context- Returns:
- the multifactor authentication provider from application context
-
evaluateEventForProviderInContext
public static Set<org.springframework.webflow.execution.Event> evaluateEventForProviderInContext(org.apereo.cas.authentication.principal.Principal principal, org.apereo.cas.services.RegisteredService registeredService, org.apereo.cas.authentication.principal.Service service, Optional<org.springframework.webflow.execution.RequestContext> context, org.apereo.cas.authentication.MultifactorAuthenticationProvider provider) Evaluate event for provider in context set.- Parameters:
principal- the principalregisteredService- the serviceservice- the servicecontext- the contextprovider- the provider- Returns:
- the set
-
getAvailableMultifactorAuthenticationProviders
public static Map<String,org.apereo.cas.authentication.MultifactorAuthenticationProvider> getAvailableMultifactorAuthenticationProviders(org.springframework.context.ApplicationContext applicationContext) Gets all multifactor authentication providers from application context.- Parameters:
applicationContext- the application context- Returns:
- the all multifactor authentication providers from application context
-
getMultifactorAuthenticationProviderById
public static Optional<org.apereo.cas.authentication.MultifactorAuthenticationProvider> getMultifactorAuthenticationProviderById(String providerId, org.springframework.context.ApplicationContext context) Method returns an Optional that will contain aMultifactorAuthenticationProviderthat has the same id as the passed providerId parameter.- Parameters:
providerId- - the id to matchcontext- - ApplicationContext- Returns:
- - Optional
-