Class AuthorizationPageModel

  • All Implemented Interfaces:
    Serializable

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

    Feel free to extend this class as necessary.

    Author:
    Takahiko Kawasaki
    See Also:
    Serialized Form
    • Constructor Detail

      • AuthorizationPageModel

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

        public AuthorizationPageModel​(com.authlete.common.dto.AuthorizationResponse info,
                                      com.authlete.common.types.User user)
        Create an AuthorizationPageModel instance using information contained in an AuthorizationResponse object, which represents a response from Authlete's /api/auth/authorization API.

        user parameter was added by version 2.1.

        Parameters:
        info - An AuthorizationResponse object, which represents a response from Authlete's /api/auth/authorization API.
        user -
    • Method Detail

      • getServiceName

        public String getServiceName()
        Get the name of the service.
        Returns:
        The name of the service.
      • setServiceName

        public AuthorizationPageModel setServiceName​(String serviceName)
        Set the name of the service.
        Parameters:
        serviceName - The name of the service.
        Returns:
        this object.
      • getClientName

        public String getClientName()
        Get the name of the client application.
        Returns:
        The name of the client application.
      • setClientName

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

        public String getDescription()
        Get the description of the client application.
        Returns:
        The description of the client application.
      • setDescription

        public AuthorizationPageModel setDescription​(String description)
        Set the description of the client application.
        Parameters:
        description - The description of the client application.
        Returns:
        this object.
      • getLogoUri

        public String getLogoUri()
        Get the URL of the logo image of the client application.
        Returns:
        The URL of the logo image of the client application.
      • setLogoUri

        public AuthorizationPageModel setLogoUri​(String logoUri)
        Set the URL of the logo image of the client application.
        Parameters:
        logoUri - The URL of the logo image of the client application.
        Returns:
        this object.
      • getClientUri

        public String getClientUri()
        Get the URL of the homepage of the client application.
        Returns:
        The URL of the homepage of the client application.
      • setClientUri

        public AuthorizationPageModel setClientUri​(String clientUri)
        Set the URL of the homepage of the client application.
        Parameters:
        clientUri - The URL of the homepage of the client application.
        Returns:
        this object.
      • getPolicyUri

        public String getPolicyUri()
        Get the URL of the policy page of the client application.
        Returns:
        The URL of the policy page of the client application.
      • setPolicyUri

        public AuthorizationPageModel setPolicyUri​(String policyUri)
        Set the URL of the policy page of the client application.
        Parameters:
        policyUri - The URL of the policy page of the client application.
        Returns:
        this object.
      • getTosUri

        public String getTosUri()
        Get the URL of "Terms of Service" page of the client application.
        Returns:
        The URL of "Terms of Service" page of the client application.
      • setTosUri

        public AuthorizationPageModel setTosUri​(String tosUri)
        Set the URL of "Terms of Service" page of the client application.
        Parameters:
        tosUri - The URL of "Terms of Service" page of the client application.
        Returns:
        this object.
      • getScopes

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

        public AuthorizationPageModel setScopes​(com.authlete.common.dto.Scope[] scopes)
        Set the list of scopes requested by the authorization request.
        Parameters:
        scopes - The list of requested scopes.
        Returns:
        this object.
      • getLoginId

        public String getLoginId()
        Get the login ID which should be set to the login ID field in the authorization page as the initial value.
        Returns:
        The initial value of the login ID.
      • setLoginId

        public AuthorizationPageModel setLoginId​(String loginId)
        Set the login ID which should be set to the login ID field in the authorization page as the initial value.
        Parameters:
        loginId - The initial value of the login ID.
        Returns:
        this object.
      • getLoginIdReadOnly

        public String getLoginIdReadOnly()
        Return "readonly" if the initial value of the login ID should not be changed.
        Returns:
        "readonly" if the initial value of the login ID should not be changed. Otherwise, null.
      • setLoginIdReadOnly

        public AuthorizationPageModel setLoginIdReadOnly​(String loginIdReadOnly)
        Set the value returned from getLoginIdReadOnly().
        Parameters:
        loginIdReadOnly - Pass "readonly" if the initial value of the login ID should not be changed. Otherwise, pass null.
        Returns:
        this object.
      • getUser

        public com.authlete.common.types.User getUser()
        Get the user.
        Returns:
        The user.
        Since:
        2.1
      • setUser

        public void setUser​(com.authlete.common.types.User user)
        Set the user.
        Parameters:
        user - The user to set.
        Since:
        2.1
      • getAuthorizationDetails

        public String getAuthorizationDetails()
        Get the content of the authorization_details request parameter in JSON format. See "OAuth 2.0 Rich Authorization Requests" for details.
        Returns:
        Authorization details in JSON format.
        Since:
        2.23
      • setAuthorizationDetails

        public void setAuthorizationDetails​(String details)
        Set the content of the authorization_details request parameter in JSON format. See "OAuth 2.0 Rich Authorization Requests" for details.
        Parameters:
        details - Authorization details in JSON format.
        Since:
        2.23
      • getVerifiedClaimsForIdToken

        public com.authlete.common.dto.Pair[] getVerifiedClaimsForIdToken()
        Get the verified claims requested for the ID token.

        For example, when an authorization request contains a claims request parameter whose content is as follow:

         {
           "id_token":{
             "verified_claims":{
               "claims":{
                 "given_name":{
                   "essential":true,
                   "purpose":"To make communication look more personal"
                 },
                 "family_name":{
                   "essential":true
                 },
                 "birthdate":{
                   "purpose":"To send you best wishes on your birthday"
                 }
               }
             }
           }
         }
         
        , this method returns an array which contains the following elements.
        Index getKey() getValue()
        0 given_name To make communication look more personal
        1 family_name
        2 birthdate To send you best wishes on your birthday

        Note that the order of the elements is not assured.

        Returns:
        Requested verified claims.
        Since:
        2.26
      • setVerifiedClaimsForIdToken

        public void setVerifiedClaimsForIdToken​(com.authlete.common.dto.Pair[] verifiedClaims)
        Set the verified claims requested for the ID token.
        Parameters:
        verifiedClaims - Requested verified claims.
        Since:
        2.26
      • isAllVerifiedClaimsForIdTokenRequested

        public boolean isAllVerifiedClaimsForIdTokenRequested()
        Get the flag indicating whether the authorization request requests all possible verified claims for the ID token.

        NOTE: In the version 1.0 of "OpenID Connect for Identity Assurance", "claims":null means "a request for all possible Claims". However, this requirement will be dropped from the future version. Therefore, this method should not be used in the future. The relevant discussion can be found in Issue 1142.

        Returns:
        true if the authorization request requests all possible verified claims for the ID token.
        Since:
        2.26
      • setAllVerifiedClaimsForIdTokenRequested

        public void setAllVerifiedClaimsForIdTokenRequested​(boolean requested)
        Set the flag indicating whether the authorization request requests all possible verified claims for the ID token.
        Parameters:
        requested - true to indicate that the authorization request requests all possible verified claims for the ID token.
        Since:
        2.26
      • getVerifiedClaimsForUserInfo

        public com.authlete.common.dto.Pair[] getVerifiedClaimsForUserInfo()
        Get the verified claims requested for the userinfo.

        For example, when an authorization request contains a claims request parameter whose content is as follow:

         {
           "userinfo":{
             "verified_claims":{
               "claims":{
                 "given_name":{
                   "essential":true,
                   "purpose":"To make communication look more personal"
                 },
                 "family_name":{
                   "essential":true
                 },
                 "birthdate":{
                   "purpose":"To send you best wishes on your birthday"
                 }
               }
             }
           }
         }
         
        , this method returns an array which contains the following elements.
        Index getKey() getValue()
        0 given_name To make communication look more personal
        1 family_name
        2 birthdate To send you best wishes on your birthday

        Note that the order of the elements is not assured.

        Returns:
        Pairs of claim name and its purpose.
        Since:
        2.26
      • setVerifiedClaimsForUserInfo

        public void setVerifiedClaimsForUserInfo​(com.authlete.common.dto.Pair[] verifiedClaims)
        Set the verified claims requested for the userinfo.
        Parameters:
        verifiedClaims - Requested verified claims.
        Since:
        2.26
      • isAllVerifiedClaimsForUserInfoRequested

        public boolean isAllVerifiedClaimsForUserInfoRequested()
        Get the flag indicating whether the authorization request requests all possible verified claims for the userinfo.

        NOTE: In the version 1.0 of "OpenID Connect for Identity Assurance", "claims":null means "a request for all possible Claims". However, this requirement will be dropped from the future version. Therefore, this method should not be used in the future. The relevant discussion can be found in Issue 1142.

        Returns:
        true if the authorization request requests all possible verified claims for the userinfo.
        Since:
        2.26
      • setAllVerifiedClaimsForUserInfoRequested

        public void setAllVerifiedClaimsForUserInfoRequested​(boolean requested)
        Set the flag indicating whether the authorization request requests all possible verified claims for the userinfo.
        Parameters:
        requested - true to indicate that the authorization request requests all possible verified claims for the userinfo.
        Since:
        2.26
      • isIdentityAssuranceRequired

        public boolean isIdentityAssuranceRequired()
        Get the flag indicating whether behaviors for Identity Assurance are required.
        Returns:
        true if behaviors for Identity Assurance are required.
        Since:
        2.26
      • setIdentityAssuranceRequired

        public void setIdentityAssuranceRequired​(boolean required)
        Get the flag indicating whether behaviors for Identity Assurance are required.
        Parameters:
        required - true to indicate that behaviors for Identity Assurance are required.
        Since:
        2.26
      • isOldIdaFormatUsed

        public boolean isOldIdaFormatUsed()
        Get the flag indicating whether the old format of "verified_claims" is used. "Old" here means the 2nd Implementer's Draft of OpenID Connect for Identity Assurance 1.0 which was published on May 19, 2020.

        The Implementer's Draft 3 of OpenID Connect for Identity Assurance 1.0, which was published on September 6, 2021, made many breaking changes.

        Returns:
        true if the old format of "verified_claims" is used.
        Since:
        2.42
        See Also:
        OpenID Connect for Identity Assurance 1.0
      • setOldIdaFormatUsed

        public void setOldIdaFormatUsed​(boolean used)
        Set the flag indicating whether the old format of "verified_claims" is used. "Old" here means the 2nd Implementer's Draft of OpenID Connect for Identity Assurance 1.0 which was published on May 19, 2020.

        The Implementer's Draft 3 of OpenID Connect for Identity Assurance 1.0, which was published on September 6, 2021, made many breaking changes.

        Parameters:
        used - true to indicate that the old format of "verified_claims" is used.
        Since:
        2.42
        See Also:
        OpenID Connect for Identity Assurance 1.0
      • getClaimsForIdToken

        public String[] getClaimsForIdToken()
        Get the claims that the client application requests to be embedded in the ID token.
        Returns:
        The claims that the client application requests to be embedded in the ID token.
        Since:
        2.56
      • setClaimsForIdToken

        public void setClaimsForIdToken​(String[] claims)
        Set the claims that the client application requests to be embedded in the ID token.
        Parameters:
        claims - The claims that the client application requests to be embedded in the ID token.
        Since:
        2.56
      • getClaimsForUserInfo

        public String[] getClaimsForUserInfo()
        Get the claims that the client application requests to be embedded in userinfo responses.
        Returns:
        The claims that the client application requests to be embedded in userinfo responses.
        Since:
        2.56
      • setClaimsForUserInfo

        public void setClaimsForUserInfo​(String[] claims)
        Set the claims that the client application requests to be embedded in userinfo responses.
        Parameters:
        claims - The claims that the client application requests to be embedded in userinfo responses.
        Since:
        2.56