public interface IAMResponse
| Modifier and Type | Method and Description |
|---|---|
boolean |
canBeRefreshed()
Check if the current response can be refreshed
|
org.gcube.common.keycloak.model.AccessToken |
getAccessToken()
Returns the access token in the response.
|
String |
getAccessTokenString()
Returns the access token in the response as string.
|
String |
getContactOrganization()
Returns the client's contact organization from the token
|
String |
getContactPerson()
Returns the client's contact person from the token
|
Set<String> |
getContextRoles()
Returns the resource roles for the resource specified in the token context
|
Set<String> |
getGlobalRoles()
Returns the realm roles in the token
|
String |
getName()
Returns the client's name from the token
|
Set<String> |
getResourceRoles(String resource)
Returns the resource roles for the resource specified in the resource parameter
|
Set<String> |
getRoles()
Returns all the roles, realm and from all the resources in the token in the same set
|
boolean |
isAccessTokenValid()
Quick way to check if the access token is valid by checking the digital signature and the token expiration
|
boolean |
isAccessTokenValid(boolean checkExpiration)
Quick way to check if the access token is valid by checking the digital signature and the token expiration if the
checkExpiration parameter is true |
boolean |
isExpired()
Check if the current response is expired
|
boolean |
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 expiration
|
boolean |
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 the
checkExpiration parameter is true |
void |
refresh()
Refreshes the current response, new data can be obtained again with accessors.
|
void |
verifyAccessToken()
Verifies the access token integrity and validity; token digital signature and expiration are reported via specific exceptions.
|
void |
verifyAccessToken(boolean checkExpiration)
Verifies the access token integrity and optionally for expiration; token digital signature and expiration are reported via specific exceptions.
|
void |
verifyRefreshToken()
Verifies the refresh token integrity and validity; token digital signature and expiration are reported via specific exceptions.
|
void |
verifyRefreshToken(boolean checkExpiration)
Verifies the refresh token integrity and validity; token digital signature and expiration are reported via specific exceptions.
|
org.gcube.common.keycloak.model.AccessToken getAccessToken()
throws D4ScienceIAMClientException
D4ScienceIAMClientException - if something goes wrong during the token decoding or JSON parsingString getAccessTokenString()
boolean isExpired()
throws D4ScienceIAMClientException
true if the response is expired, false otherwiseD4ScienceIAMClientException - if something goes wrong during the token decoding or JSON parsingboolean canBeRefreshed()
throws D4ScienceIAMClientException
true if the response can be refreshed, false otherwiseD4ScienceIAMClientException - if something goes wrong during the token decoding or JSON parsingvoid refresh()
throws D4ScienceIAMClientException
D4ScienceIAMClientException - if something goes wrong during the token refreshSet<String> getContextRoles() throws D4ScienceIAMClientException
D4ScienceIAMClientException - if something goes wrong during the token decoding or JSON parsingSet<String> getResourceRoles(String resource) throws D4ScienceIAMClientException
resource - the resource of which obtain the rolesD4ScienceIAMClientException - if something goes wrong during the token decoding or JSON parsingSet<String> getRoles() throws D4ScienceIAMClientException
D4ScienceIAMClientException - if something goes wrong during the token decoding or JSON parsingSet<String> getGlobalRoles() throws D4ScienceIAMClientException
D4ScienceIAMClientException - if something goes wrong during the token decoding or JSON parsingString getContactOrganization() throws D4ScienceIAMClientException
D4ScienceIAMClientException - if something goes wrong during the token decoding or JSON parsingString getContactPerson() throws D4ScienceIAMClientException
D4ScienceIAMClientException - if something goes wrong during the token decoding or JSON parsingString getName() throws D4ScienceIAMClientException
D4ScienceIAMClientException - if something goes wrong during the token decoding or JSON parsingboolean isAccessTokenValid()
throws D4ScienceIAMClientException
true if the access token is valid, false otherwiseD4ScienceIAMClientException - if something goes wrong during the token validity checksboolean isAccessTokenValid(boolean checkExpiration)
throws D4ScienceIAMClientException
checkExpiration parameter is truecheckExpiration - checks also if the token is expiredtrue if the access token is valid, false otherwiseD4ScienceIAMClientException - if something goes wrong during the token validity checksvoid verifyAccessToken()
throws org.gcube.io.jsonwebtoken.security.SignatureException,
org.gcube.io.jsonwebtoken.ExpiredJwtException,
D4ScienceIAMClientException
org.gcube.io.jsonwebtoken.security.SignatureException - if the token has been tampered and/or signature is invalidorg.gcube.io.jsonwebtoken.ExpiredJwtException - if the token validity is expiredD4ScienceIAMClientException - if something else goes wrong during the token verificationvoid verifyAccessToken(boolean checkExpiration)
throws org.gcube.io.jsonwebtoken.security.SignatureException,
org.gcube.io.jsonwebtoken.ExpiredJwtException,
D4ScienceIAMClientException
checkExpiration - if false token expiration check is disabledorg.gcube.io.jsonwebtoken.security.SignatureException - if the token has been tampered and/or signature is invalidorg.gcube.io.jsonwebtoken.ExpiredJwtException - if the token validity is expired if the checkExpiration argument is trueD4ScienceIAMClientException - if something else goes wrong during the token verificationboolean isRefreshTokenValid()
throws D4ScienceIAMClientException
true if the refresh token is valid, false otherwiseD4ScienceIAMClientException - if something goes wrong during the token validity checksboolean isRefreshTokenValid(boolean checkExpiration)
throws D4ScienceIAMClientException
checkExpiration parameter is truecheckExpiration - checks also if the token is expiredtrue if the refresh token is valid, false otherwiseD4ScienceIAMClientException - if something goes wrong during the token validity checksvoid verifyRefreshToken()
throws org.gcube.io.jsonwebtoken.security.SignatureException,
org.gcube.io.jsonwebtoken.ExpiredJwtException,
D4ScienceIAMClientException
org.gcube.io.jsonwebtoken.security.SignatureException - if the token has been tampered and/or signature is invalidorg.gcube.io.jsonwebtoken.ExpiredJwtException - if the token validity is expiredD4ScienceIAMClientException - if something else goes wrong during the token verificationvoid verifyRefreshToken(boolean checkExpiration)
throws org.gcube.io.jsonwebtoken.security.SignatureException,
org.gcube.io.jsonwebtoken.ExpiredJwtException,
D4ScienceIAMClientException
checkExpiration - if false token expiration check is disabledorg.gcube.io.jsonwebtoken.security.SignatureException - if the token has been tampered and/or signature is invalidorg.gcube.io.jsonwebtoken.ExpiredJwtException - if the token validity is expired if the checkExpiration argument is trueD4ScienceIAMClientException - if something else goes wrong during the token verificationCopyright © 2026. All rights reserved.