public final class AuthenticationResponse extends SecurityResponse
failed(String),
success(Subject)| Modifier and Type | Class and Description |
|---|---|
static class |
AuthenticationResponse.Builder
Authentication response builder.
|
SecurityResponse.SecurityStatus| Modifier and Type | Method and Description |
|---|---|
static AuthenticationResponse |
abstain()
Provider returning this response is not capable to make a decision (e.g.
|
static AuthenticationResponse.Builder |
builder()
Get a builder for more complex responses.
|
static AuthenticationResponse |
failed(java.lang.String message)
Construct a failed response with an explanatory message.
|
static AuthenticationResponse |
failed(java.lang.String message,
java.lang.Throwable cause)
Construct a failed response with a throwable as a cause.
|
java.util.Optional<Subject> |
getService() |
java.util.Optional<Subject> |
getUser() |
static AuthenticationResponse |
success(Principal principal)
Provider has authenticated the request and created a principal for a user.
|
static AuthenticationResponse |
success(Subject subject)
Provider has authenticated the request and created a user Subject.
|
static AuthenticationResponse |
success(Subject user,
Subject service)
Provider has authenticated the request and created a user and service Subject.
|
static AuthenticationResponse |
successService(Principal principal)
Provider has authenticated the request and created a principal for a service (or a client).
|
static AuthenticationResponse |
successService(Subject service)
Provider has authenticated the request and created a service Subject.
|
java.lang.String |
toString() |
getDescription, getRequestHeaders, getResponseHeaders, getStatus, getStatusCode, getThrowablepublic static AuthenticationResponse.Builder builder()
public static AuthenticationResponse failed(java.lang.String message, java.lang.Throwable cause)
message - Descriptive message of what happened. This message is propagated to public API!cause - Throwable causing the failed authentication. This will be logged. It may reach user only in case of debug.public static AuthenticationResponse failed(java.lang.String message)
message - Descriptive message of what happened. This message is propagated to public API!public static AuthenticationResponse abstain()
public static AuthenticationResponse success(Subject subject)
subject - Subject of the current userpublic static AuthenticationResponse success(Subject user, Subject service)
user - Subject of the current userservice - Subject of the current servicepublic static AuthenticationResponse successService(Subject service)
service - Subject of requesting service (or client)public static AuthenticationResponse success(Principal principal)
principal - principal of the usersuccess(Subject),
successService(Subject),
successService(Principal)public static AuthenticationResponse successService(Principal principal)
principal - principal of the servicesuccessService(Subject),
success(Subject),
success(Principal)public java.util.Optional<Subject> getUser()
public java.util.Optional<Subject> getService()
public java.lang.String toString()
toString in class SecurityResponseCopyright © 2018, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.