Class OAuthService
java.lang.Object
energy.eddie.regionconnector.cds.services.oauth.OAuthService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateAuthorizationUri(List<String> scopes, String customerDataClientId, URI authorizationEndpoint) pushAuthorization(List<String> scopes, String customerDataClientId, String customerDataClientSecret, URI parEndpoint, URI authorizationEndpoint) registerClient(URI registrationEndpoint) retrieveAccessToken(OAuthCredentials credentials, String customerDataClientId, String customerDataClientSecret, URI tokenEndpoint) Retrieves an access token for a specific user for a CDS server to get access to the customerdata APIsretrieveAccessToken(String authCode, String customerDataClientId, String customerDataClientSecret, URI tokenEndpoint) Retrieves the access token for a user, using the code flowretrieveAccessToken(String adminClientId, String adminClientSecret, URI tokenEndpoint) Retrieves an admin client access token for a CDS server to get access to admin APIsrevokeToken(URI revocationUri, OAuthCredentials credentials, String customerDataClientId, String customerDataClientSecret)
-
Constructor Details
-
OAuthService
-
-
Method Details
-
registerClient
-
pushAuthorization
-
createAuthorizationUri
public AuthorizationCodeResult createAuthorizationUri(List<String> scopes, String customerDataClientId, URI authorizationEndpoint) -
retrieveAccessToken
public TokenResult retrieveAccessToken(String authCode, String customerDataClientId, String customerDataClientSecret, URI tokenEndpoint) Retrieves the access token for a user, using the code flow- Parameters:
authCode- auth code that was part of the redirect URIcustomerDataClientId- the client ID for customer datacustomerDataClientSecret- the client secret for customer datatokenEndpoint- token endpoint to get access tokens- Returns:
- the result of the token request
-
retrieveAccessToken
public TokenResult retrieveAccessToken(String adminClientId, String adminClientSecret, URI tokenEndpoint) Retrieves an admin client access token for a CDS server to get access to admin APIs- Parameters:
adminClientId- the client ID of the admin clientadminClientSecret- the client secret of the admin clienttokenEndpoint- the token endpoint- Returns:
- the result of the token request
-
retrieveAccessToken
public TokenResult retrieveAccessToken(OAuthCredentials credentials, String customerDataClientId, String customerDataClientSecret, URI tokenEndpoint) Retrieves an access token for a specific user for a CDS server to get access to the customerdata APIs- Parameters:
credentials- the credentials of the usercustomerDataClientId- the client ID for customer datacustomerDataClientSecret- the client secret for customer datatokenEndpoint- the token endpoint- Returns:
- the result of the token request
-
revokeToken
public RevocationResult revokeToken(URI revocationUri, OAuthCredentials credentials, String customerDataClientId, String customerDataClientSecret)
-