Class GrantsEntity

java.lang.Object
com.auth0.client.mgmt.GrantsEntity

public class GrantsEntity extends Object
Class that provides an implementation of the Grants methods of the Management API as defined in https://auth0.com/docs/api/management/v2#!/Grants/

This class is not thread-safe.

See Also:
  • Field Details

    • client

      protected final okhttp3.OkHttpClient client
    • baseUrl

      protected final okhttp3.HttpUrl baseUrl
    • apiToken

      protected final String apiToken
  • Method Details

    • list

      public Request<GrantsPage> list(String userId, GrantsFilter filter)
      Request all Grants. A token with scope read:grants is needed See https://auth0.com/docs/api/management/v2#!/Grants/get_grants
      Parameters:
      userId - The user id of the grants to retrieve
      filter - the filter to use. Can be null.
      Returns:
      a Request to execute.
    • list

      @Deprecated public Request<List<Grant>> list(String userId)
      Deprecated.
      Calling this method will soon stop returning the complete list of grants and instead, limit to the first page of results. Please use list(String, GrantsFilter) instead as it provides pagination support.
      Request all Grants. A token with scope read:grants is needed See https://auth0.com/docs/api/management/v2#!/Grants/get_grants
      Parameters:
      userId - The user id of the grants to retrieve
      Returns:
      a Request to execute.
    • delete

      public Request<Void> delete(String grantId)
      Delete an existing Grant. A token with scope delete:grants is needed. See https://auth0.com/docs/api/management/v2#!/Grants/delete_grants_by_id
      Parameters:
      grantId - The id of the grant to delete.
      Returns:
      a Request to execute.
    • deleteAll

      public Request<Void> deleteAll(String userId)
      Deletes all Grants of a given user. A token with scope delete:grants is needed. See https://auth0.com/docs/api/management/v2#!/Grants/delete_grants_by_id
      Parameters:
      userId - The id of the user whose grants are deleted.
      Returns:
      a Request to execute.
    • voidRequest

      protected Request<Void> voidRequest(String method, Consumer<com.auth0.client.mgmt.RequestBuilder<Void>> customizer)
    • request

      protected <T> Request<T> request(String method, com.fasterxml.jackson.core.type.TypeReference<T> target, Consumer<com.auth0.client.mgmt.RequestBuilder<T>> customizer)