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(String message)
Construct a failed response with an explanatory message.
|
static AuthenticationResponse |
failed(String message,
Throwable cause)
Construct a failed response with a throwable as a cause.
|
Optional<Subject> |
service()
Service (or client) subject.
|
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.
|
String |
toString() |
Optional<Subject> |
user()
User subject.
|
description, requestHeaders, responseHeaders, status, statusCode, throwablepublic static AuthenticationResponse.Builder builder()
public static AuthenticationResponse failed(String message, 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(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 Optional<Subject> user()
Subject of the user, if one was authenticatedpublic Optional<Subject> service()
Subject of the service (or client), if one was authenticatedpublic String toString()
toString in class SecurityResponseCopyright © 2018–2019 Oracle and/or its affiliates. All rights reserved. Use is subject to license terms.