Interface XSTokenRequest


  • public interface XSTokenRequest
    Represents a token exchange request. deprecated with version 2.4.0 in favor of the new SAP Java Client library. Limitation: does not support mtls-based communication to XSUAA identity provider and will be removed with version 3.0.0.
    • Method Detail

      • isValid

        boolean isValid()
        Returns true if this object contains enough information to retrieve a token
        Returns:
        true if this object contains enough information to retrieve a token
      • getClientId

        String getClientId()
        Returns the OAuth 2.0 client ID, if set, that will be used to authenticate the client
        Returns:
        the client ID or null if not set.
      • setClientId

        XSTokenRequest setClientId​(String clientId)
        Sets the OAuth 2.0 client ID to be used for authentication during the token request
        Parameters:
        clientId - a string, no more than 255 characters identifying a valid client on the UAA
        Returns:
        this mutable object
      • getClientSecret

        String getClientSecret()
        Returns the OAuth 2.0 client secret, if set, that will be used to authenticate the client
        Returns:
        the client secret or null if not set.
      • setClientSecret

        XSTokenRequest setClientSecret​(String clientSecret)
        Sets the OAuth 2.0 client secret to be used for authentication during the token request
        Parameters:
        clientSecret - a string representing the password for a valid client on the UAA
        Returns:
        this mutable object
      • getAdditionalAuthorizationAttributes

        Map<String,​String> getAdditionalAuthorizationAttributes()
        Returns the list of requested additional authorization attributes, or null if no additional authorization attributes have been set.
        Returns:
        the list of requested additional authorization attributes, or null if no additional authorization attributes have been set.
      • setAdditionalAuthorizationAttributes

        XSTokenRequest setAdditionalAuthorizationAttributes​(Map<String,​String> additionalAuthorizationAttributes)
        Sets the requested additional authorization attributes list for this token request. Use this if you would like to add additional authorization attributes to the access token
        Parameters:
        additionalAuthorizationAttributes - a set of strings representing requested additional authorization attributes
        Returns:
        this mutable object
      • getType

        int getType()
        Returns the type of the requested token
        Returns:
        the type of the requested token
      • setType

        XSTokenRequest setType​(int type)
        Set the requested token type
        Parameters:
        type - type of token request: TYPE_USER_TOKEN or TYPE_CLIENT_CREDENTIAL_TOKEN
        Returns:
        this mutable object
      • getTokenEndpoint

        URI getTokenEndpoint()
        Returns the token exchange endpoint URI. For example https://<server>:<port>/oauth/token.
        Returns:
        the token exchange endpoint URI.
      • setTokenEndpoint

        XSTokenRequest setTokenEndpoint​(URI tokenEndpoint)
        Set the token endpoint URI
        Parameters:
        tokenEndpoint - url of token endpoint
        Returns:
        this mutable object