Class AuthenticationCallbackResponse
- java.lang.Object
-
- com.authlete.common.dto.AuthenticationCallbackResponse
-
- All Implemented Interfaces:
Serializable
public class AuthenticationCallbackResponse extends Object implements Serializable
Authentication response from a service implementation to Authlete.- Since:
- 1.1
- Author:
- Takahiko Kawasaki
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AuthenticationCallbackResponse()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetClaims()Get the claims of the authenticated user in JSON format.StringgetSubject()Get the subject (= unique identifier) of the authenticated user.booleanisAuthenticated()Get the authentication result.AuthenticationCallbackResponsesetAuthenticated(boolean authenticated)Set the authentication result.AuthenticationCallbackResponsesetClaims(String claims)Set the claims of the authenticated user in JSON format.AuthenticationCallbackResponsesetSubject(String subject)Set the subject (= unique identifier) of the authenticated user.
-
-
-
Method Detail
-
isAuthenticated
public boolean isAuthenticated()
Get the authentication result.- Returns:
trueif the credentials of the end-user were valid. Otherwise,false.
-
setAuthenticated
public AuthenticationCallbackResponse setAuthenticated(boolean authenticated)
Set the authentication result.When the credentials (
idandpassword) in the authentication callback request (AuthenticationCallbackRequest) are valid,trueshould be set to this property.- Parameters:
authenticated-trueif the credentials of the end-user were valid. Otherwise,false.- Returns:
thisobject.
-
getSubject
public String getSubject()
Get the subject (= unique identifier) of the authenticated user.- Returns:
- The subject (= unique identifier) of the authenticated user.
-
setSubject
public AuthenticationCallbackResponse setSubject(String subject)
Set the subject (= unique identifier) of the authenticated user.When the credentials (
idandpassword) in the authentication callback request (AuthenticationCallbackRequest) are valid, the subject (= unique identifier) of the end-user should be set to this property.The value of
subjectdoes not always have to be equal to the value ofidin the authentication callback request. For example,idmay be an email address but a service implementation may have generated and assigned a unique identifier such as60504791to the end-user who is represented by the email address. In such a case,60504791should be set assubject.- Parameters:
subject- The subject (= unique identifier) of the authenticated user. When the authentication failed, this property should benull.- Returns:
thisobject.
-
getClaims
public String getClaims()
Get the claims of the authenticated user in JSON format.- Returns:
- The claims of the authenticated user in JSON format.
-
setClaims
public AuthenticationCallbackResponse setClaims(String claims)
Set the claims of the authenticated user in JSON format.For example, to embed "
given_name" claim, "family_name" claim and "email" claim, the string should be formatted like the following.{ "given_name": "Takahiko", "family_name": "Kawasaki", "email": "takahiko.kawasaki@example.com" }See "5.1. Standard Claims" in OpenID Connect Core 1.0 for further details about the format.
This property does not have to be set (1) when the credentials (
idandpassword) in the authentication callback request (AuthenticationCallbackRequest) were invalid, (2) when the authentication callback request did not contain any claims (=claimsrequest parameter wasnullor empty), or (3) when the service implementation could not provide data for any of the requested claims.- Parameters:
claims- The claims of the authenticated user in JSON format.- Returns:
thisobject.
-
-