java.lang.Object
io.helidon.security.AuthenticationResponse.Builder
- All Implemented Interfaces:
Builder<AuthenticationResponse.Builder,
,AuthenticationResponse> Supplier<AuthenticationResponse>
- Enclosing class:
AuthenticationResponse
Authentication response builder.
Allows fully customized response, if one of the static methods is not sufficient (e.g. when returning a specialized
SecurityResponse.SecurityStatus
.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build authentication response.description
(String description) Set description of this security response failure.requestHeader
(String header, String value) Add a single-value header.requestHeader
(String header, List<String> values) Add a multi-value header.requestHeaders
(Map<String, List<String>> headers) Set additional/replacement headers for request.responseHeader
(String header, String value) Add a single-value header.responseHeader
(String header, List<String> values) Add a multi-value header.responseHeaders
(Map<String, List<String>> headers) Set additional/replacement headers for request.Set the service subject as created by this provider.Set security status of this security response.statusCode
(int statusCode) Set a status code for failed statuses.Set throwable causing failure of the security request.Set the user subject as created by this provider.
-
Method Details
-
user
Set the user subject as created by this provider.- Parameters:
subject
- Subject to set for current request- Returns:
- updated builder instance
-
service
Set the service subject as created by this provider.- Parameters:
subject
- Subject to set for current request- Returns:
- updated builder instance
-
build
Build authentication response.- Returns:
- Response based on this builder
-
statusCode
Set a status code for failed statuses. This is expected to use HTTP status codes. If an integration is done with a non-http protocol, you must map these status codes appropriately.- Parameters:
statusCode
- HTTP status code- Returns:
- updated builder instance
-
status
Set security status of this security response.- Parameters:
status
- Status to set- Returns:
- updated builder instance
-
description
Set description of this security response failure.- Parameters:
description
- Description to provide to called in case of failed security, or null if no information can be provided- Returns:
- updated builder instance
-
throwable
Set throwable causing failure of the security request.- Parameters:
exception
- Exception that caused failure- Returns:
- updated builder instance
-
requestHeaders
Set additional/replacement headers for request.- Parameters:
headers
- map with headers- Returns:
- updated builder instance
-
requestHeader
Add a single-value header. Note that if methodrequestHeaders(Map)
is called after this method, it will remove changes by this method.- Parameters:
header
- header namevalue
- header value- Returns:
- this instance
-
requestHeader
Add a multi-value header. Note that if methodrequestHeaders(Map)
is called after this method, it may remove changes by this method.- Parameters:
header
- header namevalues
- header values- Returns:
- this instance
-
responseHeaders
Set additional/replacement headers for request.- Parameters:
headers
- map with headers- Returns:
- updated builder instance
-
responseHeader
Add a single-value header. Note that if methodresponseHeaders(Map)
is called after this method, it will remove changes by this method.- Parameters:
header
- header namevalue
- header value- Returns:
- this instance
-
responseHeader
Add a multi-value header. Note that if methodresponseHeaders(Map)
is called after this method, it may remove changes by this method.- Parameters:
header
- header namevalues
- header values- Returns:
- this instance
-