Package com.sap.xsa.security.container
Interface XSTokenRequest
-
public interface XSTokenRequestRepresents 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.
-
-
Field Summary
Fields Modifier and Type Field Description static intTYPE_CLIENT_CREDENTIALS_TOKENstatic intTYPE_USER_TOKEN
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Map<String,String>getAdditionalAuthorizationAttributes()Returns the list of requested additional authorization attributes, or null if no additional authorization attributes have been set.StringgetClientId()Returns the OAuth 2.0 client ID, if set, that will be used to authenticate the clientStringgetClientSecret()Returns the OAuth 2.0 client secret, if set, that will be used to authenticate the clientURIgetTokenEndpoint()Returns the token exchange endpoint URI.intgetType()Returns the type of the requested tokenbooleanisValid()Returns true if this object contains enough information to retrieve a tokenXSTokenRequestsetAdditionalAuthorizationAttributes(Map<String,String> additionalAuthorizationAttributes)Sets the requested additional authorization attributes list for this token request.XSTokenRequestsetClientId(String clientId)Sets the OAuth 2.0 client ID to be used for authentication during the token requestXSTokenRequestsetClientSecret(String clientSecret)Sets the OAuth 2.0 client secret to be used for authentication during the token requestXSTokenRequestsetTokenEndpoint(URI tokenEndpoint)Set the token endpoint URIXSTokenRequestsetType(int type)Set the requested token type
-
-
-
Field Detail
-
TYPE_USER_TOKEN
static final int TYPE_USER_TOKEN
- See Also:
- Constant Field Values
-
TYPE_CLIENT_CREDENTIALS_TOKEN
static final int TYPE_CLIENT_CREDENTIALS_TOKEN
- See Also:
- Constant Field Values
-
-
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
nullif 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
nullif 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 examplehttps://<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
-
-