Class ConsentorResult
Object
se.curity.identityserver.sdk.oauth.consent.ConsentorResult
- Direct Known Subclasses:
ConsentorResult.Pending,ConsentorResult.Success,ConsentorResult.Unsuccessful
Represents the result of applying a consentor
- Since:
- 4.1.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classRepresents a pending result.static final classRepresents a success result.static final classRepresents an Unsuccessful result. -
Method Summary
Modifier and TypeMethodDescriptionstatic ConsentorResult.Pendingpending(ConsentorCompletion action) Creates a pending result.static ConsentorResult.PendingCreates a pending "prompt user" result.static ConsentorResult.PendingCreates a pending redirect result.static ConsentorResult.Successsuccess(ConsentorResultAttributes consentorResultAttributes) Creates a success result.static ConsentorResult.UnsuccessfulunsuccessfulResult(String errorDescription, ErrorCode errorCode) Creates an Unsuccessful result.
-
Method Details
-
success
Creates a success result. Used when the consentor ended successfully.- Parameters:
consentorResultAttributes- the consent result attributes returned by the consentor.- Returns:
- A success result.
-
unsuccessfulResult
public static ConsentorResult.Unsuccessful unsuccessfulResult(String errorDescription, ErrorCode errorCode) Creates an Unsuccessful result. Used when the consentor is not able to finish the consent process, not necessarily due to an error (e.g. cancellation).- Parameters:
errorDescription- A string describing the error.errorCode- TheErrorCodeassociated to the failed result.- Returns:
- An Unsuccessful result.
-
pending
Creates a pending result. Used when the consentor processing needs to be continued, e.g. by an interaction step.- Returns:
- A pending result.
-
pendingWithRedirectCompletion
Creates a pending redirect result. Used when the consentor processing needs to be continued by a redirect to an URL.- Returns:
- A pending result.
-
pendingWithPromptUserCompletion
Creates a pending "prompt user" result. Used when the consentor processing needs to interact with the user.- Returns:
- A pending result.
-