Class DeviceVerificationResponse
- java.lang.Object
-
- com.authlete.common.dto.ApiResponse
-
- com.authlete.common.dto.DeviceVerificationResponse
-
- All Implemented Interfaces:
Serializable
public class DeviceVerificationResponse extends ApiResponse
Response from Authlete's/api/device/verificationAPI.Authlete's
/api/device/verificationAPI returns JSON which can be mapped to this class. The authorization server implementation should retrieve the value ofactionfrom the response and take the following steps according to the value.VALID-
When the value of
actionisVALID, it means that the user code exists, has not expired, and belongs to the service. The authorization server implementation should interact with the end-user to ask whether she approves or rejects the authorization request from the device. EXPIRED-
When the value of
actionisEXPIRED, it means that the user code has expired. The authorization server implementation should tell the end-user that the user code has expired and urge her to re-initiate a device flow. NOT_EXIST-
When the value of
actionisNOT_EXIST, it means that the user code does not exist. The authorization server implementation should tell the end-user that the user code is invalid and urge her to retry to input a valid user code. SERVER_ERROR-
When the value of
actionisSERVER_ERROR, it means that an error occurred on Authlete side. The authorization server implementation should tell the end-user that something wrong happened and urge her to re-initiate a device flow.
- Since:
- 2.42
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDeviceVerificationResponse.ActionThe next action that the authorization server implementation should take.
-
Constructor Summary
Constructors Constructor Description DeviceVerificationResponse()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String[]getAcrs()Get the list of ACR values requested by the device authorization request.DeviceVerificationResponse.ActiongetAction()Get the next action that the authorization server should take.AuthzDetailsgetAuthorizationDetails()Get the authorization details.String[]getClaimNames()Get the names of the claims which were requested indirectly via some special scopes.Pair[]getClientAttributes()Get the attributes of the client.URIgetClientEntityId()Get the entity ID of the client.longgetClientId()Get the client ID of the client application to which the user code has been issued.StringgetClientIdAlias()Get the client ID alias of the client application to which the user code has been issued.StringgetClientIdentifier()Get the client identifier used in the device authorization request for the user code.StringgetClientName()Get the name of the client application to which the user code has been issued.DynamicScope[]getDynamicScopes()Get the dynamic scopes which the client application requested by thescoperequest parameter.longgetExpiresAt()Get the date in milliseconds since the Unix epoch (1970-01-01) at which the user code will expire.GMActiongetGmAction()Get the value of thegrant_management_actionrequest parameter of the device authorization request.GrantgetGrant()Get the content of the grant which is identified by thegrant_idrequest parameter of the device authorization request.StringgetGrantId()Get the value of thegrant_idrequest parameter of the device authorization request.StringgetGrantSubject()Get the subject of the user who has given the grant which is identified by thegrant_idrequest parameter of the device authorization request.URI[]getResources()Get the resources specified by theresourcerequest parameters in the preceding device authorization request.Scope[]getScopes()Get the scopes requested by the device authorization request for the user code.Pair[]getServiceAttributes()Get the attributes of the service that the client application belongs to.booleanisClientEntityIdUsed()Get the flag which indicates whether the entity ID of the client was used in the device authorization request as a client ID.booleanisClientIdAliasUsed()Get the flag which indicates whether the client ID alias was used in the device authorization request for the user code.DeviceVerificationResponsesetAcrs(String[] acrs)Set the list of ACR values requested by the device authorization request.DeviceVerificationResponsesetAction(DeviceVerificationResponse.Action action)Set the next action that the authorization server should take.DeviceVerificationResponsesetAuthorizationDetails(AuthzDetails details)Set the authorization details.DeviceVerificationResponsesetClaimNames(String[] names)Set the names of the claims which were requested indirectly via some special scopes.DeviceVerificationResponsesetClientAttributes(Pair[] attributes)Set the attributes of the client.DeviceVerificationResponsesetClientEntityId(URI entityId)Set the entity ID of the client.DeviceVerificationResponsesetClientEntityIdUsed(boolean used)Set the flag which indicates whether the entity ID of the client was used in the device authorization request as a client ID.DeviceVerificationResponsesetClientId(long clientId)Set the client ID of the client application to which the user code has been issued.DeviceVerificationResponsesetClientIdAlias(String alias)Set the client ID alias of the client application to which the user code has been issued.DeviceVerificationResponsesetClientIdAliasUsed(boolean used)Set the flag which indicates whether the client ID alias was used in the device authorization request for the user code.DeviceVerificationResponsesetClientName(String name)Set the name of the client application to which the user code has been issued.DeviceVerificationResponsesetDynamicScopes(DynamicScope[] dynamicScopes)Set the dynamic scopes which the client application requested by thescoperequest parameter.DeviceVerificationResponsesetExpiresAt(long expiresAt)Set the date in milliseconds since the Unix epoch (1970-01-01) at which the user code will expire.DeviceVerificationResponsesetGmAction(GMAction action)Set the value of thegrant_management_actionrequest parameter of the device authorization request.DeviceVerificationResponsesetGrant(Grant grant)Set the content of the grant which is identified by thegrant_idrequest parameter of the device authorization request.DeviceVerificationResponsesetGrantId(String grantId)Set the value of thegrant_idrequest parameter of the device authorization request.DeviceVerificationResponsesetGrantSubject(String subject)Set the subject of the user who has given the grant which is identified by thegrant_idrequest parameter of the device authorization request.DeviceVerificationResponsesetResources(URI[] resources)Set the resources specified by theresourcerequest parameters in the preceding device authorization request.DeviceVerificationResponsesetScopes(Scope[] scopes)Set the scopes requested by the device authorization request for the user code.DeviceVerificationResponsesetServiceAttributes(Pair[] attributes)Set the attributes of the service that the client application belongs to.-
Methods inherited from class com.authlete.common.dto.ApiResponse
getResponseHeaders, getResultCode, getResultMessage, setResponseHeaders, setResultCode, setResultMessage
-
-
-
-
Method Detail
-
getAction
public DeviceVerificationResponse.Action getAction()
Get the next action that the authorization server should take.- Returns:
- The next action.
-
setAction
public DeviceVerificationResponse setAction(DeviceVerificationResponse.Action action)
Set the next action that the authorization server should take.- Parameters:
action- The next action.- Returns:
thisobject.
-
getClientId
public long getClientId()
Get the client ID of the client application to which the user code has been issued.- Returns:
- The client ID of the client application.
-
setClientId
public DeviceVerificationResponse setClientId(long clientId)
Set the client ID of the client application to which the user code has been issued.- Parameters:
clientId- The client ID of the client application.- Returns:
thisobject.
-
getClientIdAlias
public String getClientIdAlias()
Get the client ID alias of the client application to which the user code has been issued.- Returns:
- The client ID alias of the client application.
-
setClientIdAlias
public DeviceVerificationResponse setClientIdAlias(String alias)
Set the client ID alias of the client application to which the user code has been issued.- Parameters:
alias- The client ID alias of the client application.- Returns:
thisobject.
-
isClientIdAliasUsed
public boolean isClientIdAliasUsed()
Get the flag which indicates whether the client ID alias was used in the device authorization request for the user code.- Returns:
trueif the client ID alias was used in the request.
-
setClientIdAliasUsed
public DeviceVerificationResponse setClientIdAliasUsed(boolean used)
Set the flag which indicates whether the client ID alias was used in the device authorization request for the user code.- Parameters:
used-trueto indicate that the client ID alias was used in the request.- Returns:
thisobject.
-
getClientEntityId
public URI getClientEntityId()
Get the entity ID of the client."Entity ID" is a technical term defined in OpenID Federation 1.0.
- Returns:
- The entity ID of the client.
- Since:
- 3.37, Authlete 2.3
- See Also:
- OpenID Federation 1.0
-
setClientEntityId
public DeviceVerificationResponse setClientEntityId(URI entityId)
Set the entity ID of the client."Entity ID" is a technical term defined in OpenID Federation 1.0.
- Parameters:
entityId- The entity ID of the client.- Returns:
thisobject.- Since:
- 3.37, Authlete 2.3
- See Also:
- OpenID Federation 1.0
-
isClientEntityIdUsed
public boolean isClientEntityIdUsed()
Get the flag which indicates whether the entity ID of the client was used in the device authorization request as a client ID."Entity ID" is a technical term defined in OpenID Federation 1.0.
- Returns:
trueif the entity ID of the client was used in the request as a client ID.- Since:
- 3.37, Authlete 2.3
- See Also:
- OpenID Federation 1.0
-
setClientEntityIdUsed
public DeviceVerificationResponse setClientEntityIdUsed(boolean used)
Set the flag which indicates whether the entity ID of the client was used in the device authorization request as a client ID."Entity ID" is a technical term defined in OpenID Federation 1.0.
- Parameters:
used-trueto indicate that the entity ID of the client was used in the request as a client ID.- Returns:
thisobject.- Since:
- 3.37, Authlete 2.3
- See Also:
- OpenID Federation 1.0
-
getClientIdentifier
public String getClientIdentifier()
Get the client identifier used in the device authorization request for the user code.When
isClientIdAliasUsed()returnstrue, this method returns the same value asgetClientIdAlias()does. Otherwise, ifisClientEntityIdUsed()returnstrue, this method returns the same value asgetClientEntityId().toString()does. In other cases, this method returns the string representation of the value returned fromgetClientId().- Returns:
- The client identifier used in the device authorization request for the user code.
-
getClientName
public String getClientName()
Get the name of the client application to which the user code has been issued.- Returns:
- The name of the client application.
-
setClientName
public DeviceVerificationResponse setClientName(String name)
Set the name of the client application to which the user code has been issued.- Parameters:
name- The name of the client application.- Returns:
thisobject.
-
getScopes
public Scope[] getScopes()
Get the scopes requested by the device authorization request for the user code.Note that
Scope.getDescription()method andScope.getDescriptions()method of each element (Scopeinstance) in the array returned from this method always returnnulleven if descriptions of the scopes are registered.- Returns:
- The requested scopes.
-
setScopes
public DeviceVerificationResponse setScopes(Scope[] scopes)
Set the scopes requested by the device authorization request for the user code.- Parameters:
scopes- The requested scopes.- Returns:
thisobject.
-
getDynamicScopes
public DynamicScope[] getDynamicScopes()
Get the dynamic scopes which the client application requested by thescoperequest parameter. See the description ofDynamicScopefor details.- Returns:
- The list of dynamic scopes.
- Since:
- 2.92
- See Also:
DynamicScope
-
setDynamicScopes
public DeviceVerificationResponse setDynamicScopes(DynamicScope[] dynamicScopes)
Set the dynamic scopes which the client application requested by thescoperequest parameter. See the description ofDynamicScopefor details.- Parameters:
dynamicScopes- The list of dynamic scopes.- Returns:
thisobject.- Since:
- 2.92
- See Also:
DynamicScope
-
getClaimNames
public String[] getClaimNames()
Get the names of the claims which were requested indirectly via some special scopes. See 5.4. Requesting Claims using Scope Values in OpenID Connect Core 1.0 for details.This method always returns
nullif thescoperequest parameter of the device authorization request does not include theopenidscope even if special scopes (such asprofile) are included in the request (unless theopenidscope is included in the default set of scopes which is used when thescoperequest parameter is omitted).- Returns:
- The names of the requested claims.
- Since:
- 2.44
-
setClaimNames
public DeviceVerificationResponse setClaimNames(String[] names)
Set the names of the claims which were requested indirectly via some special scopes.- Parameters:
names- The names of the requested claims.- Returns:
thisobject.- Since:
- 2.44
-
getAcrs
public String[] getAcrs()
Get the list of ACR values requested by the device authorization request.- Returns:
- The list of requested ACR values.
- Since:
- 2.44
-
setAcrs
public DeviceVerificationResponse setAcrs(String[] acrs)
Set the list of ACR values requested by the device authorization request.- Parameters:
acrs- The list of requested ACR values.- Returns:
thisobject.- Since:
- 2.44
-
getExpiresAt
public long getExpiresAt()
Get the date in milliseconds since the Unix epoch (1970-01-01) at which the user code will expire.- Returns:
- The expiration date in milliseconds since the Unix epoch (1970-01-01) at which the user code will expire.
- Since:
- 2.44
-
setExpiresAt
public DeviceVerificationResponse setExpiresAt(long expiresAt)
Set the date in milliseconds since the Unix epoch (1970-01-01) at which the user code will expire.- Parameters:
expiresAt- The expiration date in milliseconds since the Unix epoch (1970-01-01) at which the user code will expire.- Returns:
thisobject.- Since:
- 2.44
-
getResources
public URI[] getResources()
Get the resources specified by theresourcerequest parameters in the preceding device authorization request. See "Resource Indicators for OAuth 2.0" for details.- Returns:
- Target resources.
- Since:
- 2.62
-
setResources
public DeviceVerificationResponse setResources(URI[] resources)
Set the resources specified by theresourcerequest parameters in the preceding device authorization request. See "Resource Indicators for OAuth 2.0" for details.- Parameters:
resources- Target resources.- Returns:
thisobject.- Since:
- 2.62
-
getAuthorizationDetails
public AuthzDetails getAuthorizationDetails()
Get the authorization details. This represents the value of the"authorization_details"request parameter which is defined in "OAuth 2.0 Rich Authorization Requests".- Returns:
- Authorization details.
- Since:
- 2.56
-
setAuthorizationDetails
public DeviceVerificationResponse setAuthorizationDetails(AuthzDetails details)
Set the authorization details. This represents the value of the"authorization_details"request parameter which is defined in "OAuth 2.0 Rich Authorization Requests".- Parameters:
details- Authorization details.- Returns:
thisobject.- Since:
- 2.56
-
getGmAction
public GMAction getGmAction()
Get the value of thegrant_management_actionrequest parameter of the device authorization request.The
grant_management_actionrequest parameter is defined in Grant Management for OAuth 2.0, which is supported by Authlete 2.3 and newer versions.- Returns:
- A grant management action.
nullor one ofCREATE,REPLACEandMERGE. - Since:
- 3.6
- See Also:
- Grant Management for OAuth 2.0
-
setGmAction
public DeviceVerificationResponse setGmAction(GMAction action)
Set the value of thegrant_management_actionrequest parameter of the device authorization request.The
grant_management_actionrequest parameter is defined in Grant Management for OAuth 2.0, which is supported by Authlete 2.3 and newer versions.- Parameters:
action- A grant management action.nullor one ofCREATE,REPLACEandMERGE.- Returns:
thisobject.- Since:
- 3.6
- See Also:
- Grant Management for OAuth 2.0
-
getGrantId
public String getGrantId()
Get the value of thegrant_idrequest parameter of the device authorization request.The
grant_idrequest parameter is defined in Grant Management for OAuth 2.0, which is supported by Authlete 2.3 and newer versions.- Returns:
- A grant ID.
- Since:
- 3.6
- See Also:
- Grant Management for OAuth 2.0
-
setGrantId
public DeviceVerificationResponse setGrantId(String grantId)
Set the value of thegrant_idrequest parameter of the device authorization request.The
grant_idrequest parameter is defined in Grant Management for OAuth 2.0, which is supported by Authlete 2.3 and newer versions.- Parameters:
grantId- A grant ID.- Returns:
thisobject.- Since:
- 3.6
- See Also:
- Grant Management for OAuth 2.0
-
getGrantSubject
public String getGrantSubject()
Get the subject of the user who has given the grant which is identified by thegrant_idrequest parameter of the device authorization request.Authlete 2.3 and newer versions support Grant Management for OAuth 2.0. An authorization request may contain a
grant_idrequest parameter which is defined in the specification. If the value of the request parameter is valid,getGrantSubject()will return the subject of the user who has given the grant to the client application. Authorization server implementations may use the value returned fromgetGrantSubject()in order to determine the user to authenticate.The user your system will authenticate during the authorization process (or has already authenticated) may be different from the user of the grant. The first implementer's draft of "Grant Management for OAuth 2.0" does not mention anything about the case, so the behavior in the case is left to implementations. Authlete will not perform the grant management action when the
subjectpassed to Authlete does not match the user of the grant.- Returns:
- The subject of the user who has given the grant.
- Since:
- 3.6
- See Also:
- Grant Management for OAuth 2.0
-
setGrantSubject
public DeviceVerificationResponse setGrantSubject(String subject)
Set the subject of the user who has given the grant which is identified by thegrant_idrequest parameter of the device authorization request.Authlete 2.3 and newer versions support Grant Management for OAuth 2.0. An authorization request may contain a
grant_idrequest parameter which is defined in the specification. If the value of the request parameter is valid,getGrantSubject()will return the subject of the user who has given the grant to the client application. Authorization server implementations may use the value returned fromgetGrantSubject()in order to determine the user to authenticate.The user your system will authenticate during the authorization process (or has already authenticated) may be different from the user of the grant. The first implementer's draft of "Grant Management for OAuth 2.0" does not mention anything about the case, so the behavior in the case is left to implementations. Authlete will not perform the grant management action when the
subjectpassed to Authlete does not match the user of the grant.- Parameters:
subject- The subject of the user who has given the grant.- Returns:
thisobject.- Since:
- 3.6
- See Also:
- Grant Management for OAuth 2.0
-
getGrant
public Grant getGrant()
Get the content of the grant which is identified by thegrant_idrequest parameter of the device authorization request.The user your system will authenticate during the authorization process (or has already authenticated) may be different from the user of the grant. Be careful when your system displays the content of the grant.
- Returns:
- The content of the grant.
- Since:
- 3.6
- See Also:
- Grant Management for OAuth 2.0
-
setGrant
public DeviceVerificationResponse setGrant(Grant grant)
Set the content of the grant which is identified by thegrant_idrequest parameter of the device authorization request.The user your system will authenticate during the authorization process (or has already authenticated) may be different from the user of the grant. Be careful when your system displays the content of the grant.
- Parameters:
grant- The content of the grant.- Returns:
thisobject.- Since:
- 3.6
- See Also:
- Grant Management for OAuth 2.0
-
getServiceAttributes
public Pair[] getServiceAttributes()
Get the attributes of the service that the client application belongs to.This property is available since Authlete 2.2.
- Returns:
- The attributes of the service.
- Since:
- 2.88
-
setServiceAttributes
public DeviceVerificationResponse setServiceAttributes(Pair[] attributes)
Set the attributes of the service that the client application belongs to.This property is available since Authlete 2.2.
- Parameters:
attributes- The attributes of the service.- Returns:
thisobject.- Since:
- 2.88
-
getClientAttributes
public Pair[] getClientAttributes()
Get the attributes of the client.This property is available since Authlete 2.2.
- Returns:
- The attributes of the client.
- Since:
- 2.88
-
setClientAttributes
public DeviceVerificationResponse setClientAttributes(Pair[] attributes)
Set the attributes of the client.This property is available since Authlete 2.2.
- Parameters:
attributes- The attributes of the client.- Returns:
thisobject.- Since:
- 2.88
-
-