Class AuthenticationActionResult
Object
se.curity.identityserver.sdk.authenticationaction.AuthenticationActionResult
- Direct Known Subclasses:
AuthenticationActionResult.FailedAuthenticationActionResult,AuthenticationActionResult.PendingCompletionAuthenticationActionResult,AuthenticationActionResult.SuccessAuthenticationActionResult
This class is used to produce results for authentication actions.
- Since:
- 3.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic final classstatic final class -
Method Summary
Modifier and TypeMethodDescriptionstatic AuthenticationActionResultfailedResult(String description) The action decided to fail authentication.static AuthenticationActionResultfailedResult(String description, ErrorCode errorCode) The action decided to fail authentication.static AuthenticationActionResultpendingResult(RequiredActionCompletion requiredActionCompletion) The action needs completion.static AuthenticationActionResultpendingResult(RequiredActionCompletion requiredActionCompletion, AuthenticationAttributes intermediateAttributes) The action needs completion.static AuthenticationActionResultsuccessfulResult(AuthenticationAttributes authenticationAttributes) Use when the action decided that it's done and successful.abstract <T> Tvisit(Function<AuthenticationActionResult.SuccessAuthenticationActionResult, T> onSuccess, Function<AuthenticationActionResult.PendingCompletionAuthenticationActionResult, T> onPending, Function<AuthenticationActionResult.FailedAuthenticationActionResult, T> onFailure) Visit this authentication action result.abstract AuthenticationActionResultwithActionId(@Nullable String actionId)
-
Method Details
-
successfulResult
public static AuthenticationActionResult successfulResult(AuthenticationAttributes authenticationAttributes) Use when the action decided that it's done and successful.- Parameters:
authenticationAttributes- the resulting attributes from the action- Returns:
- a success result object for the controller
-
failedResult
The action decided to fail authentication. This will result in the user being redirected back to the caller (client) with an error of authentication failed (access denied)- Parameters:
description- The text message to pass back to the client- Returns:
- a failed result object for the controller
-
failedResult
The action decided to fail authentication. This will result in the user being redirected back to the caller (client) with an error of authentication failed using the error code provided- Parameters:
description- The description of why the result is failerrorCode- The error code present- Returns:
- a failed result object for the controller
-
pendingResult
public static AuthenticationActionResult pendingResult(RequiredActionCompletion requiredActionCompletion) The action needs completion. It is not success nor failure but requires the controller to call completion actions.- Parameters:
requiredActionCompletion- The completion that is required for the action to be able to succeed- Returns:
- a pending completion object for the controller
-
pendingResult
public static AuthenticationActionResult pendingResult(RequiredActionCompletion requiredActionCompletion, AuthenticationAttributes intermediateAttributes) The action needs completion. It is not success nor failure but requires the controller to call completion actions.- Parameters:
requiredActionCompletion- The completion that is required for the action to be able to succeed.intermediateAttributes- The new intermediate result.- Returns:
- a pending completion object for the controller
- Since:
- 4.0.0
-
withActionId
-
getActionId
-
visit
public abstract <T> T visit(Function<AuthenticationActionResult.SuccessAuthenticationActionResult, T> onSuccess, Function<AuthenticationActionResult.PendingCompletionAuthenticationActionResult, T> onPending, Function<AuthenticationActionResult.FailedAuthenticationActionResult, T> onFailure) Visit this authentication action result.- Type Parameters:
T- type of return value- Parameters:
onSuccess- function to execute on successonPending- function to execute on a pending resultonFailure- function to execute on a failure result- Returns:
- the result returned by the executed function
- Since:
- 6.2.0
-