Uses of Class
org.gcube.common.iam.D4ScienceIAMClientException
-
Uses of D4ScienceIAMClientException in org.gcube.common.iam
Methods in org.gcube.common.iam that throw D4ScienceIAMClientExceptionModifier and TypeMethodDescriptionD4ScienceIAMClient.authenticate(String clientId, String clientSecret) Authenticates the client with provided id and secretD4ScienceIAMClient.authenticate(String clientId, String clientSecret, String context) Authenticates the client with provided credentials, reducing the token audience to the requested `context`D4ScienceIAMClient.authenticateUser(String username, String password) Deprecated.this authn method is deprecated in the oauth2 specifications (see https://oauth.net/2/grant-types/password/)D4ScienceIAMClient.authenticateUser(String username, String password, String context) Deprecated.this authn method is deprecated in the oauth2 specifications (see https://oauth.net/2/grant-types/password/)D4ScienceIAMClient.authenticateUser(String clientId, String clientSecret, String username, String password) Deprecated.this authn method is deprecated in the oauth2 specifications (see https://oauth.net/2/grant-types/password/)D4ScienceIAMClient.authenticateUser(String clientId, String clientSecret, String username, String password, String context) Deprecated.this authn method is deprecated in the oauth2 specifications (see https://oauth.net/2/grant-types/password/)D4ScienceIAMClient.authenticateWithCode(String clientId, String clientSecret, String code, String redirectUri, String codeVerifier) Authenticates with the code received on the redirect URI of the authorization code flow.D4ScienceIAMClient.authorizationURL(String clientId, String redirectUri) Starts the URL of the authorization endpoint the browser has to be redirected to (authorization code flow).Directly authorizes the client by using the provided credentials, for the specific context audience and with no optional permissionsD4ScienceIAMClient.authorize(String clientId, String clientSecret, String context, List<String> permissions) Directly authorizes the client by using the provided credentials, for the specific context audience and with optional permissionsAuthorizes 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.booleanAbstractIAMResponse.canBeRefreshed()booleanIAMResponse.canBeRefreshed()Check if the current response can be refreshedvoidvoidExchanges and updates the current response with new one obtained with parameters provided.voidAbstractIAMResponse.exchangeForRefreshToken(String clientId, String clientSecret, String audience, String scope) Same asAbstractIAMResponse.exchange(String, String, String, String)but asks the IAM also for a refresh token (requested_token_type=refresh_token): afterwardsAbstractIAMResponse.getRefreshTokenString()gives it, andAbstractIAMResponse.getRefreshExpiresIn()its lifetime.org.gcube.common.keycloak.model.AccessTokenAbstractIAMResponse.getAccessToken()org.gcube.common.keycloak.model.AccessTokenIAMResponse.getAccessToken()Returns the access token in the response.String[]AbstractIAMResponse.getAudience()default String[]IAMResponse.getAudience()Returns theaudclaim of the access token, as in the token (the contexts are URL-encoded)AbstractIAMResponse.getAuthorizedParty()default StringIAMResponse.getAuthorizedParty()Returns theazpclaim of the access token: the client the token was issued toAbstractIAMResponse.getContactOrganization()IAMResponse.getContactOrganization()Returns the client's contact organization from the tokenAbstractIAMResponse.getContactPerson()IAMResponse.getContactPerson()Returns the client's contact person from the tokenAbstractIAMResponse.getContext()IAMResponse.getContext()Returns the token context is issued for This is done by checking in the order: If the token contains thed4s_contextclaim, as specified also inKeycloakClient.D4S_DYNAMIC_SCOPE_NAME_TOKEN_CLAIMThe value of theaudclaim if contains a single value (for retro-compatibility) It returnsnullif none of the options are satisfied and the context cannot be determined.AbstractIAMResponse.getContextRoles()IAMResponse.getContextRoles()Returns the resource roles for the resource specified in the token contextAbstractIAMResponse.getEmail()default StringIAMResponse.getEmail()Returns theemailclaim of the access tokenAbstractIAMResponse.getFamilyName()default StringIAMResponse.getFamilyName()Returns thefamily_nameclaim of the access tokenAbstractIAMResponse.getGivenName()default StringIAMResponse.getGivenName()Returns thegiven_nameclaim of the access tokenAbstractIAMResponse.getGlobalRoles()IAMResponse.getGlobalRoles()Returns the realm roles in the tokenAbstractIAMResponse.getName()IAMResponse.getName()Returns the client's name from the tokenAbstractIAMResponse.getPreferredUsername()default StringIAMResponse.getPreferredUsername()Returns thepreferred_usernameclaim of the access tokenAbstractIAMResponse.getResourceAccessRoles()IAMResponse.getResourceAccessRoles()Returns the roles of the token per resource (client), as in theresource_accessclaim.AbstractIAMResponse.getResourceRoles(String resource) IAMResponse.getResourceRoles(String resource) Returns the resource roles for the resource specified in the resource parameterAbstractIAMResponse.getRoles()IAMResponse.getRoles()Returns all the roles, realm and from all the resources in the token in the same setAbstractIAMResponse.getSubject()default StringIAMResponse.getSubject()Returns thesubclaim of the access tokenD4ScienceIAMClient.introspect(String token, String clientId, String clientSecret) Asks the IAM server of this client (never the issuer named in the token) whether the token is active and which claims it carries (token introspection, RFC 7662).booleanAbstractIAMResponse.isAccessTokenValid()booleanAbstractIAMResponse.isAccessTokenValid(boolean checkExpiration) booleanIAMResponse.isAccessTokenValid()Quick way to check if the access token is valid by checking the digital signature and the token expirationbooleanIAMResponse.isAccessTokenValid(boolean checkExpiration) Quick way to check if the access token is valid by checking the digital signature and the token expiration if thecheckExpirationparameter istruebooleanAbstractIAMResponse.isExpired()booleanIAMResponse.isExpired()Check if the current response is expiredbooleanAbstractIAMResponse.isRefreshTokenValid()booleanAbstractIAMResponse.isRefreshTokenValid(boolean checkExpiration) booleanIAMResponse.isRefreshTokenValid()Quick way to check if the refresh token present in the current response and it is valid by checking the digital signature and the token expirationbooleanIAMResponse.isRefreshTokenValid(boolean checkExpiration) Quick way to check if the refresh token present in the current response and it is valid by checking the digital signature and the token expiration if thecheckExpirationparameter istruebooleanD4ScienceIAMClient.isTokenValid(String token) Checks if the token is valid (signature and expiration).booleanD4ScienceIAMClient.isTokenValid(String token, boolean checkExpiration) Checks if the token is valid and optionally checks for expiration.voidEnds the user session on the IAM (end session endpoint) using the refresh token.static D4ScienceIAMClientD4ScienceIAMClient.newInstance(String contextInfra) Creates a new client for the specific context, in the default IAM realm.static D4ScienceIAMClientD4ScienceIAMClient.newInstance(String contextInfra, String realm) Creates a new client for the specific context, in the default realm.protected static final org.gcube.common.keycloak.model.TokenResponseD4ScienceIAMClientAuthn4Client.performClientAuthn(D4ScienceIAMClient iamClient, String clientId, String clientSecret, String context) Performs the actual client authentication using client credentials flow.protected static final org.gcube.common.keycloak.model.TokenResponseD4ScienceIAMClientAuthn4User.performUserAuthn(D4ScienceIAMClient iamClient, String clientId, String clientSecret, String username, String password, String context) Performs user authentication using username and password credentials.voidAbstractIAMResponse.refresh()voidRefreshes the token using the specified client credentials.voidIAMResponse.refresh()Refreshes the current response, new data can be obtained again with accessors.voidAbstractIAMResponse.verifyAccessToken()voidAbstractIAMResponse.verifyAccessToken(boolean checkExpiration) voidIAMResponse.verifyAccessToken()Verifies the access token integrity and validity; token digital signature and expiration are reported via specific exceptions.voidIAMResponse.verifyAccessToken(boolean checkExpiration) Verifies the access token integrity and optionally for expiration; token digital signature and expiration are reported via specific exceptions.voidAbstractIAMResponse.verifyRefreshToken()voidAbstractIAMResponse.verifyRefreshToken(boolean checkExpiration) voidIAMResponse.verifyRefreshToken()Verifies the refresh token integrity and validity; token digital signature and expiration are reported via specific exceptions.voidIAMResponse.verifyRefreshToken(boolean checkExpiration) Verifies the refresh token integrity and validity; token digital signature and expiration are reported via specific exceptions.Constructors in org.gcube.common.iam that throw D4ScienceIAMClientExceptionModifierConstructorDescriptionprotectedD4ScienceIAMClientAuthn4Client(D4ScienceIAMClient iamClient, String clientId, String clientSecret) Creates a new client authentication instance using client credentials.protectedD4ScienceIAMClientAuthn4Client(D4ScienceIAMClient iamClient, String clientId, String clientSecret, String context) Creates a new client authentication instance with specific context.protectedD4ScienceIAMClientAuthn4Code(D4ScienceIAMClient iamClient, String clientId, String clientSecret, String code, String redirectUri, String codeVerifier) Exchanges the authorization code for the tokens.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.protectedD4ScienceIAMClientAuthz(D4ScienceIAMClientAuthn authn, String context, List<String> permissions) Creates a new authorization instance using an existing authentication.protectedD4ScienceIAMClientAuthz(D4ScienceIAMClient iamClient, String clientId, String clientSecret, String context, List<String> permissions) Creates a new authorization instance using client credentials.