Package org.gcube.common.iam
Class D4ScienceIAMClientAuthn4User
- java.lang.Object
-
- org.gcube.common.iam.AbstractIAMResponse
-
- org.gcube.common.iam.D4ScienceIAMClientAuthn
-
- org.gcube.common.iam.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:
- Luca Frosini (ISTI-CNR)
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedD4ScienceIAMClientAuthn4User(D4ScienceIAMClient iamClient, String clientId, String clientSecret, String username, String password)Creates a new user authentication instance without context.protectedD4ScienceIAMClientAuthn4User(D4ScienceIAMClient iamClient, String clientId, String clientSecret, String username, String password, String context)Creates a new user authentication instance with context.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static org.gcube.common.keycloak.model.TokenResponseperformUserAuthn(D4ScienceIAMClient iamClient, String clientId, String clientSecret, String username, String password, String context)Performs user authentication using username and password credentials.-
Methods inherited from class org.gcube.common.iam.D4ScienceIAMClientAuthn
authorize, authorize
-
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 Detail
-
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 clientclientId- the client IDclientSecret- the client secretusername- the usernamepassword- 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 clientclientId- the client IDclientSecret- the client secretusername- the usernamepassword- the passwordcontext- the context (optional)- Throws:
D4ScienceIAMClientException- if authentication fails
-
-
Method Detail
-
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 clientclientId- the client IDclientSecret- the client secretusername- the usernamepassword- the passwordcontext- the context (optional)- Returns:
- the token response
- Throws:
D4ScienceIAMClientException- if authentication fails
-
-