Class DeviceAuthorizationPageModel

  • All Implemented Interfaces:
    Serializable

    public class DeviceAuthorizationPageModel
    extends Object
    implements Serializable
    Model class to hold data which are referred to in an authorization page in device flow.

    Feel free to extend this class as necessary.

    Since:
    2.18
    Author:
    Hideki Ikeda
    See Also:
    Serialized Form
    • Constructor Detail

      • DeviceAuthorizationPageModel

        public DeviceAuthorizationPageModel()
        The default constructor with default values.
      • DeviceAuthorizationPageModel

        public DeviceAuthorizationPageModel​(com.authlete.common.dto.DeviceVerificationResponse info)
        Create an DeviceAuthorizationPageModel instance using information contained in an DeviceVerificationResponse object, which represents a response from Authlete's /api/device/verification API.
        Parameters:
        info - An DeviceVerificationResponse object, which represents a response from Authlete's /api/device/verification API.
    • Method Detail

      • 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 DeviceAuthorizationPageModel 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:
        this object.
      • 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 DeviceAuthorizationPageModel 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:
        this object.
      • 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:
        true if the client ID alias was used in the request.
      • setClientIdAliasUsed

        public DeviceAuthorizationPageModel 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 - true to indicate that the client ID alias was used in the request.
        Returns:
        this object.
      • getClientIdentifier

        public String getClientIdentifier()
        Get the client identifier used in the device authorization request for the user code.

        When isClientIdAliasUsed() returns true, this method returns the same value as getClientIdAlias() does. Otherwise, this method returns the string representation of the value returned from getClientId().

        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.
        Returns:
        The name of the client application.
      • setClientName

        public DeviceAuthorizationPageModel setClientName​(String clientName)
        Set the name of the client application.
        Parameters:
        clientName - The name of the client application.
        Returns:
        this object.
      • getScopes

        public com.authlete.common.dto.Scope[] getScopes()
        Get the list of scopes requested by the device authorization request for the user code.
        Returns:
        The list of requested scopes.
      • setScopes

        public DeviceAuthorizationPageModel setScopes​(com.authlete.common.dto.Scope[] scopes)
        Set the list of scopes requested by the device authorization request for the user code.
        Parameters:
        scopes - The list of requested scopes.
        Returns:
        this object.