Class D4ScienceIAMClientAuthn

java.lang.Object
org.gcube.common.iam.AbstractIAMResponse
org.gcube.common.iam.D4ScienceIAMClientAuthn
All Implemented Interfaces:
IAMResponse
Direct Known Subclasses:
D4ScienceIAMClientAuthn4Client, D4ScienceIAMClientAuthn4User

public abstract class D4ScienceIAMClientAuthn extends AbstractIAMResponse
Abstract base class for D4Science IAM client authentication responses. Provides functionality for obtaining authorization after successful authentication.
Author:
Mauro Mugnaini (Nubisware S.r.l.)
  • Constructor Details

    • D4ScienceIAMClientAuthn

      public D4ScienceIAMClientAuthn(D4ScienceIAMClient iamClient, org.gcube.common.keycloak.model.TokenResponse tokenResponse)
      Creates a new authentication response.
      Parameters:
      iamClient - the D4Science IAM client instance
      tokenResponse - the token response from authentication
  • Method Details

    • authorize

      public D4ScienceIAMClientAuthz authorize(String context) throws D4ScienceIAMClientException
      Authorizes the client or the user by using the authn already obtained, for the specific context audience and no optional permissions.
      Parameters:
      context - the requested token context audience (e.g. a specific context or another client)
      Returns:
      the authz object
      Throws:
      D4ScienceIAMClientException - if an error occurs during authz process
    • authorize

      public D4ScienceIAMClientAuthz authorize(String context, List<String> permissions) throws D4ScienceIAMClientException
      Authorizes the client or the user by using the authn already obtained, for the specific context audience and with optional permissions.
      Parameters:
      context - the requested token context audience (e.g. a specific context or another client)
      permissions - the optional permissions
      Returns:
      the authz object
      Throws:
      D4ScienceIAMClientException - if an error occurs during authz process