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
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 Summary
ConstructorsModifierConstructorDescriptionprotectedD4ScienceIAMClientAuthn4User(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
Modifier and TypeMethodDescriptionprotected static final 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, authorizeMethods 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
-
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 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 clientclientId- the client IDclientSecret- the client secretusername- the usernamepassword- the passwordcontext- the context (optional)- Returns:
- the token response
- Throws:
D4ScienceIAMClientException- if authentication fails
-