Class PasswordTokenFlow
java.lang.Object
com.sap.cloud.security.xsuaa.tokenflows.PasswordTokenFlow
-
Constructor Summary
ConstructorsConstructorDescriptionPasswordTokenFlow(OAuth2TokenService tokenService, OAuth2ServiceEndpointsProvider endpointsProvider, ClientIdentity clientIdentity) -
Method Summary
Modifier and TypeMethodDescriptiondisableCache(boolean disableCache) Can be used to disable the cache for the flow.execute()Executes this flow against the XSUAA endpoint.optionalParameters(Map<String, String> optionalParameters) Adds additional authorization attributes to the request.The password for the user trying to get a token.Set the Subdomain the token is requested for.The username for the user trying to get a token.
-
Constructor Details
-
PasswordTokenFlow
public PasswordTokenFlow(@Nonnull OAuth2TokenService tokenService, @Nonnull OAuth2ServiceEndpointsProvider endpointsProvider, @Nonnull ClientIdentity clientIdentity)
-
-
Method Details
-
execute
Executes this flow against the XSUAA endpoint. As a result the exchanged JWT token is returned.- Returns:
- the JWT instance returned by XSUAA.
- Throws:
IllegalStateException- - in case not all mandatory fields of the token flow request have been set.TokenFlowException- - in case of an error during the flow, or when the token cannot be obtained.
-
password
The password for the user trying to get a token. This is a required parameter.- Parameters:
password- - the password.- Returns:
- this builder.
-
username
The username for the user trying to get a token. This is a required parameter.- Parameters:
username- - the username.- Returns:
- this builder.
-
subdomain
Set the Subdomain the token is requested for.- Parameters:
subdomain- - the subdomain.- Returns:
- this builder.
-
optionalParameters
Adds additional authorization attributes to the request.- Parameters:
optionalParameters- - the optional parameters.- Returns:
- this builder.
-
disableCache
Can be used to disable the cache for the flow.- Parameters:
disableCache- - disables cache when set totrue.- Returns:
- this builder.
-