Package org.apache.polaris.test.keycloak
Interface KeycloakAccess
- All Known Implementing Classes:
KeycloakContainer
public interface KeycloakAccess
A facade interface for accessing Keycloak server functionalities.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe claim name used to identify the principal in Keycloak tokens. -
Method Summary
Modifier and TypeMethodDescriptionvoidassignRoleToUser(String role, String user) Assigns a role to a user in Keycloak.voidcreateRole(String name) Creates a new role in Keycloak with the specified name.voidcreateServiceAccount(String clientId, String clientSecret) Creates a new service account in Keycloak with the specified client ID and client secret.voidcreateUser(String name, String password) Creates a new user in Keycloak.voiddeleteRole(String name) Deletes a role in Keycloak with the specified name.voiddeleteServiceAccount(String clientId) Deletes a service account in Keycloak with the specified client ID.voiddeleteUser(String name) Deletes a user in Keycloak with the specified name.Returns the URL of the Keycloak issuer.Obtains an access token from the Keycloak server.Returns the URL of the Keycloak token endpoint.default StringReturns the path of the Keycloak token endpoint.
-
Field Details
-
PRINCIPAL_NAME_CLAIM
The claim name used to identify the principal in Keycloak tokens.- See Also:
-
-
Method Details
-
getIssuerUrl
URI getIssuerUrl()Returns the URL of the Keycloak issuer. This is typicallyhttps://<keycloak-server>/realms/<realm-name>. -
getTokenEndpoint
URI getTokenEndpoint()Returns the URL of the Keycloak token endpoint. This is typicallyhttps://<keycloak-server>/realms/<realm-name>/protocol/openid-connect/token. -
getTokenPath
Returns the path of the Keycloak token endpoint. This is typically/realms/<realm-name>/protocol/openid-connect/token. -
createRole
Creates a new role in Keycloak with the specified name. -
createUser
Creates a new user in Keycloak. -
assignRoleToUser
Assigns a role to a user in Keycloak. Both the role and the user must exist. -
createServiceAccount
Creates a new service account in Keycloak with the specified client ID and client secret. -
deleteRole
Deletes a role in Keycloak with the specified name. -
deleteUser
Deletes a user in Keycloak with the specified name. -
deleteServiceAccount
Deletes a service account in Keycloak with the specified client ID. -
getToken
Obtains an access token from the Keycloak server. The passed map becomes the POST request body and should contain the grant type and all required parameters.
-