Class D4ScienceIAMClientAuthn4User

All Implemented Interfaces:
IAMResponse

public class D4ScienceIAMClientAuthn4User extends D4ScienceIAMClientAuthn
D4Science IAM client authentication implementation for user credentials. Handles authentication using username and password credentials with optional context.
Author:
Mauro Mugnaini (Nubisware S.r.l.)
  • Constructor Details

    • D4ScienceIAMClientAuthn4User

      protected D4ScienceIAMClientAuthn4User(D4ScienceIAMClient iamClient, String clientId, String clientSecret, String username, String password) throws D4ScienceIAMClientException
      Creates a new user authentication instance without context.
      Parameters:
      iamClient - the IAM client
      clientId - the client ID
      clientSecret - the client secret
      username - the username
      password - the password
      Throws:
      D4ScienceIAMClientException - if authentication fails
    • D4ScienceIAMClientAuthn4User

      protected D4ScienceIAMClientAuthn4User(D4ScienceIAMClient iamClient, String clientId, String clientSecret, String username, String password, String context) throws D4ScienceIAMClientException
      Creates a new user authentication instance with context.
      Parameters:
      iamClient - the IAM client
      clientId - the client ID
      clientSecret - the client secret
      username - the username
      password - the password
      context - the context (optional)
      Throws:
      D4ScienceIAMClientException - if authentication fails
  • Method Details

    • performUserAuthn

      protected static final org.gcube.common.keycloak.model.TokenResponse performUserAuthn(D4ScienceIAMClient iamClient, String clientId, String clientSecret, String username, String password, String context) throws D4ScienceIAMClientException
      Performs user authentication using username and password credentials.
      Parameters:
      iamClient - the IAM client
      clientId - the client ID
      clientSecret - the client secret
      username - the username
      password - the password
      context - the context (optional)
      Returns:
      the token response
      Throws:
      D4ScienceIAMClientException - if authentication fails