Class AbstractBuildErrorResponseFromEvent<T extends com.nimbusds.oauth2.sdk.ErrorResponse>
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- org.opensaml.profile.action.AbstractProfileAction
-
- org.opensaml.profile.action.AbstractConditionalProfileAction
-
- net.shibboleth.idp.profile.AbstractProfileAction
-
- net.shibboleth.idp.plugin.oidc.op.profile.impl.AbstractBuildErrorResponseFromEvent<T>
-
- Type Parameters:
T- ErrorResponse implementation.
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,ProfileAction,Aware,MessageSource,MessageSourceAware,Action
- Direct Known Subclasses:
BuildAuthenticationErrorResponseFromEvent,BuildIntrospectionErrorResponseFromEvent,BuildJSONErrorResponseFromEvent,BuildRegistrationErrorResponseFromEvent,BuildRevokeTokenErrorResponseFromEvent,BuildTokenErrorResponseFromEvent,BuildUserInfoErrorResponseFromEvent
public abstract class AbstractBuildErrorResponseFromEvent<T extends com.nimbusds.oauth2.sdk.ErrorResponse> extends net.shibboleth.idp.profile.AbstractProfileActionThis action is extended by error response actions. Action reads an event from the configuredEventContextlookup strategy, constructs an OIDC error response message and attaches it as the outbound message, if outbound message context was found.
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_ERROR_CODEDefault value for the error code in the error response messages.static intDEFAULT_HTTP_STATUS_CODEDefault value for the HTTP response status code in the HTTP responses.private StringdefaultCodeThe code for unmapped events.private intdefaultStatusCodeThe status code for unmapped events.private Function<ProfileRequestContext,EventContext>eventContextLookupStrategyStrategy function for access toEventContextto check.private org.slf4j.LoggerlogClass logger.private Map<String,com.nimbusds.oauth2.sdk.ErrorObject>mappedErrorsMap of eventIds to pre-configured error objects.
-
Constructor Summary
Constructors Constructor Description AbstractBuildErrorResponseFromEvent()Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract TbuildErrorResponse(com.nimbusds.oauth2.sdk.ErrorObject error, ProfileRequestContext profileRequestContext)Method implemented by the extending class to create ErrorResponse.protected voiddoExecute(ProfileRequestContext profileRequestContext)protected booleandoPreExecute(ProfileRequestContext profileRequestContext)voidsetDefaultCode(String code)Set the code for unmapped events.voidsetDefaultStatusCode(int code)Set the status code for unmapped events.voidsetEventContextLookupStrategy(Function<ProfileRequestContext,EventContext> strategy)Set lookup strategy forEventContextto check.voidsetMappedErrors(Map<String,com.nimbusds.oauth2.sdk.ErrorObject> errors)Set map of eventIds to pre-configured error objects.-
Methods inherited from class net.shibboleth.idp.profile.AbstractProfileAction
doExecute, execute, getMessage, getMessage, getMessage, getProfileContextLookupStrategy, getRequestContext, getResult, setMessageSource, setProfileContextLookupStrategy
-
Methods inherited from class org.opensaml.profile.action.AbstractConditionalProfileAction
getActivationCondition, setActivationCondition
-
Methods inherited from class org.opensaml.profile.action.AbstractProfileAction
doPostExecute, doPostExecute, execute, getHttpServletRequest, getHttpServletResponse, getLogPrefix, setHttpServletRequest, setHttpServletResponse
-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, doInitialize, initialize, isDestroyed, isInitialized
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.shibboleth.utilities.java.support.component.InitializableComponent
initialize, isInitialized
-
-
-
-
Field Detail
-
DEFAULT_ERROR_CODE
public static final String DEFAULT_ERROR_CODE
Default value for the error code in the error response messages.- See Also:
- Constant Field Values
-
DEFAULT_HTTP_STATUS_CODE
public static final int DEFAULT_HTTP_STATUS_CODE
Default value for the HTTP response status code in the HTTP responses.- See Also:
- Constant Field Values
-
log
@Nonnull private final org.slf4j.Logger log
Class logger.
-
eventContextLookupStrategy
@Nonnull private Function<ProfileRequestContext,EventContext> eventContextLookupStrategy
Strategy function for access toEventContextto check.
-
mappedErrors
private Map<String,com.nimbusds.oauth2.sdk.ErrorObject> mappedErrors
Map of eventIds to pre-configured error objects.
-
defaultStatusCode
private int defaultStatusCode
The status code for unmapped events.
-
defaultCode
private String defaultCode
The code for unmapped events.
-
-
Method Detail
-
setDefaultStatusCode
public void setDefaultStatusCode(int code)
Set the status code for unmapped events.- Parameters:
code- The default status code for unmapped events.
-
setDefaultCode
public void setDefaultCode(@Nonnull String code)Set the code for unmapped events.- Parameters:
code- The default status code for unmapped events.
-
setEventContextLookupStrategy
public void setEventContextLookupStrategy(@Nonnull Function<ProfileRequestContext,EventContext> strategy)Set lookup strategy forEventContextto check.- Parameters:
strategy- lookup strategy
-
setMappedErrors
public void setMappedErrors(@Nonnull Map<String,com.nimbusds.oauth2.sdk.ErrorObject> errors)Set map of eventIds to pre-configured error objects.- Parameters:
errors- map of eventIds to pre-configured error objects.
-
buildErrorResponse
protected abstract T buildErrorResponse(com.nimbusds.oauth2.sdk.ErrorObject error, ProfileRequestContext profileRequestContext)
Method implemented by the extending class to create ErrorResponse.- Parameters:
error- error object to build the response from.profileRequestContext- profile request context.- Returns:
- ErrorResponse
-
doPreExecute
protected boolean doPreExecute(@Nonnull ProfileRequestContext profileRequestContext)- Overrides:
doPreExecutein classAbstractConditionalProfileAction
-
doExecute
protected void doExecute(@Nonnull ProfileRequestContext profileRequestContext)- Overrides:
doExecutein classAbstractProfileAction
-
-