Interface OAuth2ClientService

    • Method Detail

      • hasClient

        boolean hasClient​(String clientId)
        Checks if an oAuth2 client with the given client id exists.

        Done as a privileged user.

        Parameters:
        clientId - the client id of the oAuth2 client whose existence to check
        Returns:
        true if an oAuth2 client with the given client id exists, false otherwise
      • isValidClient

        boolean isValidClient​(String clientId,
                              String clientSecret)
        Checks if the oAuth2 client with the given client id is valid regarding the given client secret.

        Done as a privileged user.

        Parameters:
        clientId - the client id of the oAuth2 client to validate
        clientSecret - the client secret used for validation
        Returns:
        true if the oAuth2 client with the given client id is valid regarding the given client secret, false otherwise
      • getClient

        OAuth2Client getClient​(String clientId)
        Gets the oAuth2 client with the given client id.

        Done as a privileged user.

        Parameters:
        clientId - the client id of the oAuth2 client to get
        Returns:
        the oAuth2 client with the given client id if it exists, null otherwise
      • getClients

        List<OAuth2ClientgetClients()
        Gets all the oAuth2 clients.

        Done as a privileged user.

        Returns:
        the oAuth2 clients
        Since:
        10.2
      • create

        OAuth2Client create​(OAuth2Client oAuth2Client,
                            NuxeoPrincipal principal)
        Registers a new oAuth2 client as the given principal.
        Parameters:
        oAuth2Client - the OAuth2Client to register
        principal - the current user
        Returns:
        the newly registered client
        Throws:
        NuxeoException - with 403 status code if the given principal doesn't have access to the oAuth2 clients
        Since:
        11.1
      • update

        OAuth2Client update​(String clientId,
                            OAuth2Client oAuth2Client,
                            NuxeoPrincipal principal)
        Updates an exiting oAuth2 client as the given principal.
        Parameters:
        clientId - the client id of oAuth2Client to update
        oAuth2Client - the new OAuth2Client data
        principal - the current user
        Returns:
        the updated oAuth2Client
        Throws:
        NuxeoException - with 403 status code if the given principal doesn't have access to the oAuth2 clients
        Since:
        11.1
      • delete

        void delete​(String clientId,
                    NuxeoPrincipal principal)
        Deletes an oAuth2 client as the given principal.
        Parameters:
        clientId - the client id of the oAuth2Client to delete
        principal - the current user
        Throws:
        NuxeoException - with 403 status code if the given principal doesn't have access to the oAuth2 clients
        Since:
        11.1