Class XsuaaTokenFlows
java.lang.Object
com.sap.cloud.security.xsuaa.tokenflows.XsuaaTokenFlows
- All Implemented Interfaces:
Serializable
A bean that can be
This class uses a RestTemplate which it passes on to the builders.
@Autowired by applications to get access to token
flow builders. The token flow builders allow for the execution of a client
credentials flow (to get a technical user token) and a jwt bearer token flow
(to get an exchange token with different scopes). This class uses a RestTemplate which it passes on to the builders.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionXsuaaTokenFlows(OAuth2TokenService oAuth2TokenService, OAuth2ServiceEndpointsProvider endpointsProvider, ClientIdentity clientIdentity) Create a new instance of this bean with the given RestTemplate. -
Method Summary
Modifier and TypeMethodDescriptionCreates a new Client Credentials Flow builder object.Creates a new JWT Bearer Token Flow builder object.
Token, authorize and key set endpoints will be derived relative to the base URI.Creates a new Password Token Flow builder object.
Token, authorize and key set endpoints will be derived relative to the base URI.Creates a new Refresh Token Flow builder object.
Token, authorize and key set endpoints will be derived relative to the base URI.
-
Constructor Details
-
XsuaaTokenFlows
public XsuaaTokenFlows(OAuth2TokenService oAuth2TokenService, OAuth2ServiceEndpointsProvider endpointsProvider, ClientIdentity clientIdentity) Create a new instance of this bean with the given RestTemplate. Applications should@Autowireinstances of this bean.- Parameters:
oAuth2TokenService- the OAuth2TokenService that will be used to send the token exchange request.endpointsProvider- the endpoint provider that serves the token endpoint.clientIdentity- the OAuth2.0 client identityString clientId = "<<get your client id from your service binding>>"; String clientSecret = "<<get your client secret from your service binding>>"; String xsuaaBaseUrl = "<<get your xsuaa base url from service binding>>"; XsuaaTokenFlows tokenFlows = new XsuaaTokenFlows( new DefaultOAuth2TokenService(), new XsuaaDefaultEndpoints(xsuaaBaseUrl), new ClientCredentials(clientId, clientSecret));
-
-
Method Details
-
clientCredentialsTokenFlow
Creates a new Client Credentials Flow builder object.
Token, authorize and key set endpoints will be derived relative to the base URI.- Returns:
- the
ClientCredentialsTokenFlowbuilder object.
-
refreshTokenFlow
Creates a new Refresh Token Flow builder object.
Token, authorize and key set endpoints will be derived relative to the base URI.- Returns:
- the
RefreshTokenFlowbuilder object.
-
passwordTokenFlow
Creates a new Password Token Flow builder object.
Token, authorize and key set endpoints will be derived relative to the base URI.- Returns:
- the
PasswordTokenFlowbuilder object.
-
jwtBearerTokenFlow
Creates a new JWT Bearer Token Flow builder object.
Token, authorize and key set endpoints will be derived relative to the base URI.- Returns:
- the
JwtBearerTokenFlowbuilder object.
-