Class AuthenticationActionResult

Object
se.curity.identityserver.sdk.authenticationaction.AuthenticationActionResult
Direct Known Subclasses:
AuthenticationActionResult.FailedAuthenticationActionResult, AuthenticationActionResult.PendingCompletionAuthenticationActionResult, AuthenticationActionResult.SuccessAuthenticationActionResult

public abstract class AuthenticationActionResult extends Object
This class is used to produce results for authentication actions.
Since:
3.0.0
  • 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

      public static AuthenticationActionResult failedResult(String description)
      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

      public static AuthenticationActionResult failedResult(String description, ErrorCode errorCode)
      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 fail
      errorCode - 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

      public abstract AuthenticationActionResult withActionId(@Nullable String actionId)
    • getActionId

      @Nullable public abstract @Nullable String getActionId()
    • visit

      Visit this authentication action result.
      Type Parameters:
      T - type of return value
      Parameters:
      onSuccess - function to execute on success
      onPending - function to execute on a pending result
      onFailure - function to execute on a failure result
      Returns:
      the result returned by the executed function
      Since:
      6.2.0