Class ClientIdCredentials

java.lang.Object
org.gcube.documentstore.security.credentials.ClientIdCredentials
All Implemented Interfaces:
org.gcube.common.security.credentials.Credentials, DocumentStoreCredential

public class ClientIdCredentials extends Object implements DocumentStoreCredential
The ClientIdCredentials class implements the DocumentStoreCredential interface and provides methods to handle client ID and secret credentials for accessing a document store.

This class includes methods for setting and getting the client ID and secret, as well as methods for obtaining contexts and secrets for specific contexts from a Keycloak client.

Annotations:

  • @NotNull: Ensures that the annotated field is not null.
  • @NotEmpty: Ensures that the annotated field is not empty.

Fields:

  • clientID: The client ID used for authentication.
  • secret: The secret associated with the client ID.

Methods:

  • getClientID(): Returns the client ID.
  • setClientID(String clientID): Sets the client ID.
  • getSecret(): Returns the secret.
  • setSecret(String secret): Sets the secret.
  • hashCode(): Generates a hash code for the object.
  • equals(Object obj): Compares this object with the specified object for equality.
  • toString(): Returns a string representation of the object.
  • getContexts(KeycloakClient client, String endpoint): Retrieves the contexts associated with the client ID and secret from the Keycloak client.
  • getSecretForContext(KeycloakClient client, String endpoint, String context): Retrieves the secret for a specific context from the Keycloak client.

Logging:

  • logger: Logs debug and error messages.
  • Constructor Details

    • ClientIdCredentials

      public ClientIdCredentials()
  • Method Details