Class XsuaaTokenFlows
- java.lang.Object
-
- com.sap.cloud.security.xsuaa.tokenflows.XsuaaTokenFlows
-
- All Implemented Interfaces:
Serializable
public class XsuaaTokenFlows extends Object implements Serializable
A bean that can be@Autowiredby 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 user token flow (to get an exchange token with different scopes).
This class uses a RestTemplate which it passes on to the builders.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description XsuaaTokenFlows(OAuth2TokenService oAuth2TokenService, OAuth2ServiceEndpointsProvider endpointsProvider, ClientIdentity clientIdentity)Create a new instance of this bean with the given RestTemplate.XsuaaTokenFlows(OAuth2TokenService oAuth2TokenService, OAuth2ServiceEndpointsProvider endpointsProvider, ClientCredentials clientCredentials)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ClientCredentialsTokenFlowclientCredentialsTokenFlow()Creates a new Client Credentials Flow builder object.PasswordTokenFlowpasswordTokenFlow()Creates a new Refresh Token Flow builder object.
Token, authorize and key set endpoints will be derived relative to the base URI.RefreshTokenFlowrefreshTokenFlow()Creates a new Refresh Token Flow builder object.
Token, authorize and key set endpoints will be derived relative to the base URI.UserTokenFlowuserTokenFlow()Creates a new User Token Flow builder object.
-
-
-
Constructor Detail
-
XsuaaTokenFlows
@Deprecated public XsuaaTokenFlows(OAuth2TokenService oAuth2TokenService, OAuth2ServiceEndpointsProvider endpointsProvider, ClientCredentials clientCredentials)
Deprecated.
-
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 Detail
-
userTokenFlow
public UserTokenFlow userTokenFlow()
Creates a new User Token Flow builder object. Token, authorize and key set endpoints will be derived relative to the base URI.- Returns:
- the
UserTokenFlowbuilder object.
-
clientCredentialsTokenFlow
public ClientCredentialsTokenFlow 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
public RefreshTokenFlow 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
public PasswordTokenFlow passwordTokenFlow()
Creates a new Refresh Token Flow builder object.
Token, authorize and key set endpoints will be derived relative to the base URI.- Returns:
- the
PasswordTokenFlowbuilder object.
-
-