java.lang.Object
energy.eddie.regionconnector.cds.services.oauth.OAuthService

@Service public class OAuthService extends Object
  • Constructor Details

  • Method Details

    • registerClient

      public RegistrationResponse registerClient(URI registrationEndpoint)
    • pushAuthorization

      public ParResponse pushAuthorization(List<String> scopes, String customerDataClientId, String customerDataClientSecret, URI parEndpoint, URI authorizationEndpoint)
    • 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 URI
      customerDataClientId - the client ID for customer data
      customerDataClientSecret - the client secret for customer data
      tokenEndpoint - 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 client
      adminClientSecret - the client secret of the admin client
      tokenEndpoint - 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 user
      customerDataClientId - the client ID for customer data
      customerDataClientSecret - the client secret for customer data
      tokenEndpoint - the token endpoint
      Returns:
      the result of the token request
    • revokeToken

      public RevocationResult revokeToken(URI revocationUri, OAuthCredentials credentials, String customerDataClientId, String customerDataClientSecret)