Class RegistrationErrorMessageLookupFunction
java.lang.Object
org.springframework.context.support.ApplicationObjectSupport
net.shibboleth.idp.plugin.authn.webauthn.context.navigate.RegistrationErrorMessageLookupFunction
- All Implemented Interfaces:
Function<ProfileRequestContext,,String> ContextDataLookupFunction<ProfileRequestContext,,String> Aware,ApplicationContextAware
public class RegistrationErrorMessageLookupFunction
extends ApplicationObjectSupport
implements ContextDataLookupFunction<ProfileRequestContext,String>
A function that examines the state of a request and produces an appropriate message for WebAuthn flow views.
NOTE: The result of this function is NOT HTML-encoded in any way and must be encoded for safety if used.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate StringMessage ID to use for generic messages.Lookup strategy to locate the WebAuthn registration information context.Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapply(ProfileRequestContext input) private StringgetClassifiedMessage(MessageSourceAccessor messageSource, String classifiedMessage) Get classified message.voidSets whether non-message-based error messages should be exposed or turned into a more generic value.voidsetWebauthnErrorContextLookupStrategy(Function<ProfileRequestContext, WebAuthnRegistrationErrorContext> strategy) Set the strategy used to lookup theWebAuthnRegistrationErrorContext.Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, initApplicationContext, isContextRequired, obtainApplicationContext, requiredContextClass, setApplicationContext
-
Field Details
-
genericMessageID
Message ID to use for generic messages. -
webauthnErrorContextLookupStrategy
@Nonnull private Function<ProfileRequestContext,WebAuthnRegistrationErrorContext> webauthnErrorContextLookupStrategyLookup strategy to locate the WebAuthn registration information context.
-
-
Constructor Details
-
RegistrationErrorMessageLookupFunction
public RegistrationErrorMessageLookupFunction()Constructor.
-
-
Method Details
-
setWebauthnErrorContextLookupStrategy
public void setWebauthnErrorContextLookupStrategy(Function<ProfileRequestContext, WebAuthnRegistrationErrorContext> strategy) Set the strategy used to lookup theWebAuthnRegistrationErrorContext.- Parameters:
strategy- The strategy to set.
-
setGenericMessageID
Sets whether non-message-based error messages should be exposed or turned into a more generic value.- Parameters:
id- message ID
-
apply
- Specified by:
applyin interfaceFunction<ProfileRequestContext,String>
-
getClassifiedMessage
@Nullable private String getClassifiedMessage(@Nonnull MessageSourceAccessor messageSource, @Nonnull String classifiedMessage) Get classified message.- Parameters:
messageSource- Spring message sourceclassifiedMessage- classified message- Returns:
- mapped message, or null if an empty string was produced.
-