Class ScimClientFactory


  • public class ScimClientFactory
    extends Object
    A factory class to obtain "client" objects that allow interaction with the SCIM service. Usage examples can be found at https://github.com/JanssenProject/jans-scim/tree/master/README.md

    Common parameters of methods here include:

    • domain: The root URL of the SCIM service. Usually in the form https://your.server.com/jans-scim/restv1
    • OIDCMetadataUrl: URL of authorization servers' metadata document. Usually in the form https://your.gluu-server.com/.well-known/openid-configuration
    • clientId: ID of an already registered OAuth2 client
    • interfaceClass: The Class to which the object returned will belong to. Normally it will be an interface in package io.jans.scim2.client.rest or io.jans.scim.ws.rs.scim2
    • Method Detail

      • getClient

        public static <T> T getClient​(Class<T> interfaceClass,
                                      String domain,
                                      String OIDCMetadataUrl,
                                      String clientId,
                                      String clientSecret,
                                      boolean secretPostAuthnMethod)
                               throws Exception
        Type Parameters:
        T - The type the object returned will belong to
        Parameters:
        interfaceClass - See class description
        domain - See class description
        OIDCMetadataUrl - See class description
        clientId - See class description
        clientSecret - Secret of the OAuth2 client
        secretPostAuthnMethod - Whether the client uses client_secret_post or client_secret_basic to authenticate against the token endpoint
        Returns:
        An object that allows to invoke service methods
        Throws:
        Exception - In case of initialization problem
      • getClient

        public static <T> T getClient​(Class<T> interfaceClass,
                                      String domain,
                                      String OIDCMetadataUrl,
                                      String clientId,
                                      Path keyStorePath,
                                      String keyStorePassword,
                                      String keyId)
                               throws Exception
        Type Parameters:
        T - The type the object returned will belong to
        Parameters:
        interfaceClass - See class description
        domain - See class description
        OIDCMetadataUrl - See class description
        clientId - See class description. It is assumed the client uses private_key_jwt mechanism to authenticate against the token endpoint
        keyStorePath - A path to a keystore whose keys may be employed to generate a client_assertion
        keyStorePassword - Password associated to the keystore
        keyId - Identifier of one of the keys. Its corresponding private key will be extracted to generate the assertion. If null is passed, the first key of the keystore will be used
        Returns:
        An object that allows to invoke service methods
        Throws:
        Exception - In case of initialization problem
      • getClient

        public static ClientSideService getClient​(String domain,
                                                  String OIDCMetadataUrl,
                                                  String clientId,
                                                  Path keyStorePath,
                                                  String keyStorePassword,
                                                  String keyId)
                                           throws Exception
        Parameters:
        domain - See class description
        OIDCMetadataUrl - See class description
        clientId - See class description. It is assumed the client uses private_key_jwt mechanism to authenticate against the token endpoint
        keyStorePath - A path to a keystore whose keys may be employed to generate a client_assertion
        keyStorePassword - Password associated to the keystore
        keyId - Identifier of one of the keys. Its corresponding private key will be extracted to generate the assertion. If null is passed, the first key of the keystore will be used
        Returns:
        An object that allows calling User, Group, and FidoDevices operations. It also has some support to call service provider configuration endpoints (see section 4 of RFC 7644)
        Throws:
        Exception - In case of initialization problem