Package org.gcube.common.iam
Class D4ScienceIAMClientAuthn
java.lang.Object
org.gcube.common.iam.AbstractIAMResponse
org.gcube.common.iam.D4ScienceIAMClientAuthn
- All Implemented Interfaces:
IAMResponse
- Direct Known Subclasses:
D4ScienceIAMClientAuthn4Client,D4ScienceIAMClientAuthn4User,OIDCBearerAuth
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 Summary
ConstructorsConstructorDescriptionD4ScienceIAMClientAuthn(D4ScienceIAMClient iamClient, org.gcube.common.keycloak.model.TokenResponse tokenResponse) Creates a new authentication response. -
Method Summary
Modifier and TypeMethodDescriptionAuthorizes the client or the user by using the authn already obtained, for the specific context audience and no optional permissions.Authorizes the client or the user by using the authn already obtained, for the specific context audience and with optional permissions.Methods inherited from class org.gcube.common.iam.AbstractIAMResponse
canBeRefreshed, getAccessToken, getAccessTokenString, getContactOrganization, getContactPerson, getContextRoles, getGlobalRoles, getIamClient, getName, getRefreshTokenString, getResourceRoles, getRoles, getTokenResponse, isAccessTokenValid, isAccessTokenValid, isExpired, isRefreshTokenValid, isRefreshTokenValid, refresh, refresh, setIamClient, setTokenResponse, verifyAccessToken, verifyRefreshToken
-
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 instancetokenResponse- the token response from authentication
-
-
Method Details
-
authorize
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
-