auth0: Query the Auth0 Managment API

Description Usage Arguments Value Examples

View source: R/package.R

Description

This is an extremely minimal client. You need to know the Auth0 API to query Auth0 endpoint.

Usage

1
2
auth0(endpoint, ..., .domain = NULL, .auth_key = api_token(),
  .method = "GET", .headers = NULL)

Arguments

endpoint

Auth0 API endpoint. Must be one of the following forms:

  • "METHOD path", e.g. "GET /api/v2/users/id"

  • "path", e.g. "/api/v2/users/id".

  • "METHOD url", e.g. "GET https://auth0-org-domain.auth0.com/api/v2/users/id"

  • "url", e.g. "https://auth0-org-domain.aut0.com/api/v2/users/id".

If the method is not supplied, .method parameter is used (GET by default).

...

Name-value pairs giving API parameters. Will be matched into url placeholders, sent as query parameters in GET requests, and in the JSON body of POST requests.

.domain

Auth0 API domain (default: api_domain). Used if endpoint contains a path only.

.auth_key

Authentication token. Sourced by default with api_token

.method

HTTP method to use if not explicitly supplied in the endpoint.

.headers

Named character vector of header field values (except Authorization, which is handled via .token). This can be used to override or augment the defaults, which are as follows: the Accept field set up to "application/json" by default and the User-Agent field "https://github.com/Appsilon/auth0-api" - default. This can be used, e.g. to provide a custom headers for special needs.

Value

Response from the Auth0 API as aut0_api object

Examples

1
2
3
4
5
6
## Not run: 
## Get user data from Auth0 Endpoint
auth0("GET /api/v2/users/{id}", id = "auth0|userid")
auth0("GET /api/v2/users/{id}", id = "auth0|userid", field = "nickname", include_fields = "false")

## End(Not run)

Appsilon/auth0api documentation built on Dec. 10, 2019, 12:09 a.m.