Package org.gcube.common.keycloak
Interface KeycloakClientLegacyIS
-
- All Superinterfaces:
org.gcube.common.keycloak.KeycloakClient
- All Known Implementing Classes:
DefaultKeycloakClientLegacyIS
public interface KeycloakClientLegacyIS extends org.gcube.common.keycloak.KeycloakClient
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description URLcomputeIntrospectionEndpointURL()Compute the keycloakintrospectionendpointURLstarting from the discovered token endpoint it in the current scope provided byScopeProvider.URLfindTokenEndpointURL()org.gcube.common.keycloak.model.TokenIntrospectionResponseintrospectAccessToken(String clientId, String clientSecret, String accessTokenJWTString)Introspects an access token against the Keycloak server discovered in the current scope.booleanisAccessTokenVerified(String clientId, String clientSecret, String accessTokenJWTString)Verifies an access token against the Keycloak server discovered in the current scope.org.gcube.common.keycloak.model.TokenResponsequeryOIDCToken(String clientId, String clientSecret)Queries an OIDC token from the Keycloak server discovered in the current scope, by using provided clientId and client secret.org.gcube.common.keycloak.model.TokenResponsequeryUMAToken(String clientId, String clientSecret, String audience, List<String> permissions)Queries an UMA token from the Keycloak server discovered in the current scope, by using provided clientId and client secret for the given audience (context), in URLEncoded form or not, and optionally a list of permissions.org.gcube.common.keycloak.model.TokenResponsequeryUMAToken(String clientId, String clientSecret, List<String> permissions)Queries an UMA token from the Keycloak server discovered in the current scope, by using provided clientId and client secret for the current scope as audience (context), in URLEncoded form or not, and optionally a list of permissions.org.gcube.common.keycloak.model.TokenResponsequeryUMAToken(org.gcube.common.keycloak.model.TokenResponse oidcTokenResponse, String audience, List<String> permissions)Queries an UMA token from the Keycloak server discovered in the current scope, by using access-token provided by theTokenResponseobject for the given audience (context), in URLEncoded form or not, and optionally a list of permissions.org.gcube.common.keycloak.model.TokenResponserefreshToken(String refreshTokenJWTString)Refreshes a previously issued token from the Keycloak server discovered in the current scope using the the refresh token JWT encoded string obtained with the access token in the previous token response.org.gcube.common.keycloak.model.TokenResponserefreshToken(String clientId, String refreshTokenJWTString)Refreshes a previously issued token from the Keycloak server discovered in the current scope using the provided client id and the refresh token JWT encoded string obtained with the access token in the previous token response.org.gcube.common.keycloak.model.TokenResponserefreshToken(String clientId, String clientSecret, String refreshTokenJWTString)Refreshes a previously issued token from the Keycloak server discovered in the current scope using the provided client id and secret and the refresh token JWT encoded string obtained with the access token in the previous token response.org.gcube.common.keycloak.model.TokenResponserefreshToken(String clientId, String clientSecret, org.gcube.common.keycloak.model.TokenResponse tokenResponse)Refreshes a previously issued token from the Keycloak server discovered in the current scope using the refresh token JWT encoded string in the token response object and the provided client id and secret.org.gcube.common.keycloak.model.TokenResponserefreshToken(String clientId, org.gcube.common.keycloak.model.TokenResponse tokenResponse)Refreshes a previously issued token from the Keycloak server discovered in the current scope using the refresh token JWT encoded string in the token response object and the provided client id.org.gcube.common.keycloak.model.TokenResponserefreshToken(org.gcube.common.keycloak.model.TokenResponse tokenResponse)Refreshes a previously issued token from the Keycloak server discovered in the current scope using the refresh token JWT encoded string in the token response object.-
Methods inherited from interface org.gcube.common.keycloak.KeycloakClient
computeIntrospectionEndpointURL, getIntrospectionEndpointURL, getRealmBaseURL, getRealmBaseURL, getTokenEndpointURL, introspectAccessToken, introspectAccessToken, isAccessTokenVerified, isAccessTokenVerified, queryOIDCToken, queryOIDCToken, queryOIDCToken, queryOIDCTokenOfUser, queryOIDCTokenOfUserWithContext, queryOIDCTokenOfUserWithContext, queryOIDCTokenOfUserWithContext, queryOIDCTokenOfUserWithContext, queryOIDCTokenWithContext, queryOIDCTokenWithContext, queryOIDCTokenWithContext, queryOIDCTokenWithContext, queryUMAToken, queryUMAToken, queryUMAToken, queryUMAToken, queryUMAToken, refreshToken, refreshToken, refreshToken, refreshToken, refreshToken
-
-
-
-
Field Detail
-
CATEGORY
static final String CATEGORY
- See Also:
- Constant Field Values
-
NAME
static final String NAME
- See Also:
- Constant Field Values
-
DESCRIPTION
static final String DESCRIPTION
- See Also:
- Constant Field Values
-
-
Method Detail
-
findTokenEndpointURL
URL findTokenEndpointURL() throws org.gcube.common.keycloak.KeycloakClientException
- Returns:
- the keycloak
tokenendpoint URL in the current scope - Throws:
org.gcube.common.keycloak.KeycloakClientException- if something goes wrong discovering the endpoint URL
-
computeIntrospectionEndpointURL
URL computeIntrospectionEndpointURL() throws org.gcube.common.keycloak.KeycloakClientException
Compute the keycloakintrospectionendpointURLstarting from the discovered token endpoint it in the current scope provided byScopeProvider.- Returns:
- the keycloak
introspectionendpoint URL in the current scope - Throws:
org.gcube.common.keycloak.KeycloakClientException- if something goes wrong discovering the endpoint URL
-
queryOIDCToken
org.gcube.common.keycloak.model.TokenResponse queryOIDCToken(String clientId, String clientSecret) throws org.gcube.common.keycloak.KeycloakClientException
Queries an OIDC token from the Keycloak server discovered in the current scope, by using provided clientId and client secret.- Specified by:
queryOIDCTokenin interfaceorg.gcube.common.keycloak.KeycloakClient- Parameters:
clientId- the client idclientSecret- the client secret- Returns:
- the issued token as
TokenResponseobject - Throws:
org.gcube.common.keycloak.KeycloakClientException- if something goes wrong performing the query
-
queryUMAToken
org.gcube.common.keycloak.model.TokenResponse queryUMAToken(org.gcube.common.keycloak.model.TokenResponse oidcTokenResponse, String audience, List<String> permissions) throws org.gcube.common.keycloak.KeycloakClientExceptionQueries an UMA token from the Keycloak server discovered in the current scope, by using access-token provided by theTokenResponseobject for the given audience (context), in URLEncoded form or not, and optionally a list of permissions.- Parameters:
clientId- the client idclientSecret- the client secretaudience- the audience (context) where to request the issuing of the ticketpermissions- a list of permissions, can benull- Returns:
- the issued token as
TokenResponseobject - Throws:
org.gcube.common.keycloak.KeycloakClientException- if something goes wrong performing the query
-
queryUMAToken
org.gcube.common.keycloak.model.TokenResponse queryUMAToken(String clientId, String clientSecret, String audience, List<String> permissions) throws org.gcube.common.keycloak.KeycloakClientException
Queries an UMA token from the Keycloak server discovered in the current scope, by using provided clientId and client secret for the given audience (context), in URLEncoded form or not, and optionally a list of permissions.- Specified by:
queryUMATokenin interfaceorg.gcube.common.keycloak.KeycloakClient- Parameters:
clientId- the client idclientSecret- the client secretaudience- the audience (context) where to request the issuing of the ticketpermissions- a list of permissions, can benull- Returns:
- the issued token as
TokenResponseobject - Throws:
org.gcube.common.keycloak.KeycloakClientException- if something goes wrong performing the query
-
queryUMAToken
org.gcube.common.keycloak.model.TokenResponse queryUMAToken(String clientId, String clientSecret, List<String> permissions) throws org.gcube.common.keycloak.KeycloakClientException
Queries an UMA token from the Keycloak server discovered in the current scope, by using provided clientId and client secret for the current scope as audience (context), in URLEncoded form or not, and optionally a list of permissions.- Parameters:
clientId- the client idclientSecret- the client secretpermissions- a list of permissions, can benull- Returns:
- the issued token as
TokenResponseobject - Throws:
org.gcube.common.keycloak.KeycloakClientException- if something goes wrong performing the query
-
refreshToken
org.gcube.common.keycloak.model.TokenResponse refreshToken(org.gcube.common.keycloak.model.TokenResponse tokenResponse) throws org.gcube.common.keycloak.KeycloakClientExceptionRefreshes a previously issued token from the Keycloak server discovered in the current scope using the refresh token JWT encoded string in the token response object. Client id will be read from "issued for" access token's claim and client secret will be not sent.
NOTE: Forpublicclients types only.- Parameters:
tokenResponse- the previously issued token asTokenResponseobject- Returns:
- the refreshed token as
TokenResponseobject - Throws:
org.gcube.common.keycloak.KeycloakClientException- if something goes wrong performing the refresh query
-
refreshToken
org.gcube.common.keycloak.model.TokenResponse refreshToken(String clientId, org.gcube.common.keycloak.model.TokenResponse tokenResponse) throws org.gcube.common.keycloak.KeycloakClientException
Refreshes a previously issued token from the Keycloak server discovered in the current scope using the refresh token JWT encoded string in the token response object and the provided client id. Client secret will be not sent.
NOTE: Forpublicclients types only.- Specified by:
refreshTokenin interfaceorg.gcube.common.keycloak.KeycloakClient- Parameters:
clientId- the requestor client id, may benulland in this case will be take from the access token "issued for" claimtokenResponse- the previously issued token asTokenResponseobject- Returns:
- the refreshed token as
TokenResponseobject - Throws:
org.gcube.common.keycloak.KeycloakClientException- if something goes wrong performing the refresh query
-
refreshToken
org.gcube.common.keycloak.model.TokenResponse refreshToken(String clientId, String clientSecret, org.gcube.common.keycloak.model.TokenResponse tokenResponse) throws org.gcube.common.keycloak.KeycloakClientException
Refreshes a previously issued token from the Keycloak server discovered in the current scope using the refresh token JWT encoded string in the token response object and the provided client id and secret.- Parameters:
clientId- the requestor client id, may benulland in this case will be take from the access token "issued for" claimclientSecret- the requestor client secret, may benullfor non-confidential clientstokenResponse- the previously issued token asTokenResponseobject- Returns:
- the refreshed token as
TokenResponseobject - Throws:
org.gcube.common.keycloak.KeycloakClientException- if something goes wrong performing the refresh query
-
refreshToken
org.gcube.common.keycloak.model.TokenResponse refreshToken(String refreshTokenJWTString) throws org.gcube.common.keycloak.KeycloakClientException
Refreshes a previously issued token from the Keycloak server discovered in the current scope using the the refresh token JWT encoded string obtained with the access token in the previous token response. Client id will be read from "issued for" refresh token's claim and client secret will be not sent.
NOTE: Forpublicclients types only.- Parameters:
refreshTokenJWTString- the previously issued refresh token JWT string taken from the same token response of the access token parameter- Returns:
- the refreshed token as
TokenResponseobject - Throws:
org.gcube.common.keycloak.KeycloakClientException- if something goes wrong performing the refresh query
-
refreshToken
org.gcube.common.keycloak.model.TokenResponse refreshToken(String clientId, String refreshTokenJWTString) throws org.gcube.common.keycloak.KeycloakClientException
Refreshes a previously issued token from the Keycloak server discovered in the current scope using the provided client id and the refresh token JWT encoded string obtained with the access token in the previous token response. Client secret will be not used.
NOTE: Forpublicclients types only.- Parameters:
clientId- the requestor client idrefreshTokenJWTString- the previously issued refresh token JWT string taken from the same token response of the access token parameter- Returns:
- the refreshed token as
TokenResponseobject - Throws:
org.gcube.common.keycloak.KeycloakClientException- if something goes wrong performing the refresh query
-
refreshToken
org.gcube.common.keycloak.model.TokenResponse refreshToken(String clientId, String clientSecret, String refreshTokenJWTString) throws org.gcube.common.keycloak.KeycloakClientException
Refreshes a previously issued token from the Keycloak server discovered in the current scope using the provided client id and secret and the refresh token JWT encoded string obtained with the access token in the previous token response.- Parameters:
clientId- the requestor client idclientSecret- the requestor client secret, may benullfor non-confidential clientsrefreshTokenJWTString- the previously issued refresh token JWT string taken from the same token response of the access token parameter- Returns:
- the refreshed token as
TokenResponseobject - Throws:
org.gcube.common.keycloak.KeycloakClientException- if something goes wrong performing the refresh query
-
introspectAccessToken
org.gcube.common.keycloak.model.TokenIntrospectionResponse introspectAccessToken(String clientId, String clientSecret, String accessTokenJWTString) throws org.gcube.common.keycloak.KeycloakClientException
Introspects an access token against the Keycloak server discovered in the current scope.- Parameters:
clientId- the requestor client idclientSecret- the requestor client secretaccessTokenJWTString- the access token to verify- Returns:
trueif the token is valid,falseotherwise- Throws:
org.gcube.common.keycloak.KeycloakClientException- if something goes wrong performing the verification
-
isAccessTokenVerified
boolean isAccessTokenVerified(String clientId, String clientSecret, String accessTokenJWTString) throws org.gcube.common.keycloak.KeycloakClientException
Verifies an access token against the Keycloak server discovered in the current scope.- Parameters:
clientId- the requestor client idclientSecret- the requestor client secretaccessTokenJWTString- the access token to verify- Returns:
- a
TokenIntrospectionResponseobject with the introspection results; in particular, theactivefield represents the token validity - Throws:
org.gcube.common.keycloak.KeycloakClientException- if something goes wrong performing the verification
-
-