Class KkClientFactory


  • public class KkClientFactory
    extends Object
    • Constructor Detail

      • KkClientFactory

        public KkClientFactory()
    • Method Detail

      • getSecret

        public org.gcube.common.security.secrets.Secret getSecret()
        keycloak configuration obtained from IS in the private constructor using the singleton pattern, it's retrieved from IS only for the first access, then kept in the singleton object
      • setSecret

        public void setSecret​(org.gcube.common.security.secrets.Secret secret)
      • setConfig

        public void setConfig​(org.gcube.idm.common.is.IsServerConfig configuration)
      • getSecretForInfrastructure

        public org.gcube.common.security.secrets.Secret getSecretForInfrastructure()
      • fetchIsConfig

        public org.gcube.idm.common.is.IsServerConfig fetchIsConfig()
                                                             throws jakarta.ws.rs.InternalServerErrorException
        Throws:
        jakarta.ws.rs.InternalServerErrorException
      • fetchIsConfig

        public org.gcube.idm.common.is.IsServerConfig fetchIsConfig​(org.gcube.common.security.secrets.Secret secret)
                                                             throws jakarta.ws.rs.InternalServerErrorException
        Throws:
        jakarta.ws.rs.InternalServerErrorException
      • createtKeycloakInstance

        public static KeycloackApiClient createtKeycloakInstance​(org.gcube.idm.common.is.IsServerConfig config,
                                                                 String context)
      • getKKRealm

        public org.keycloak.admin.client.resource.RealmResource getKKRealm()
      • getKKRealm

        public org.keycloak.admin.client.resource.RealmResource getKKRealm​(String ctx)
      • getKKClient

        public org.keycloak.admin.client.resource.ClientResource getKKClient()
      • getKKClient

        public org.keycloak.admin.client.resource.ClientResource getKKClient​(String ctx)
      • getKKClientById

        public org.keycloak.admin.client.resource.ClientResource getKKClientById​(String clientId)
        select the ClientResource by name, or current client if clientId parameter is null;
        Parameters:
        clientId -
        Returns:
        Throws:
        ServerException
        jakarta.ws.rs.NotFoundException
      • encodeClientIdContext

        public static String encodeClientIdContext​(String context)