diff --git a/EXAMPLES.md b/EXAMPLES.md index ae6204ed31..3946618976 100644 --- a/EXAMPLES.md +++ b/EXAMPLES.md @@ -24,7 +24,7 @@ import { AuthenticationClient } from 'auth0'; const auth = new AuthenticationClient({ - domain: '{YOUR_TENANT_AND REGION}.auth0.com', + domain: '{YOUR_TENANT}.{YOUR_REGION}.auth0.com', clientId: '{YOUR_CLIENT_ID}', clientSecret: '{YOUR_CLIENT_SECRET}', }); @@ -45,7 +45,7 @@ const clientAssertionSigningKey = `-----BEGIN PRIVATE KEY----- -----END PRIVATE KEY-----`; const auth = new AuthenticationClient({ - domain: '{YOUR_TENANT_AND REGION}.auth0.com', + domain: '{YOUR_TENANT}.{YOUR_REGION}.auth0.com', clientId: '{YOUR_CLIENT_ID}', clientAssertionSigningKey, }); @@ -61,7 +61,7 @@ const { data: tokens } = await auth.oauth.clientCredentialsGrant({ import { AuthenticationClient } from 'auth0'; const auth = new AuthenticationClient({ - domain: '{YOUR_TENANT_AND REGION}.auth0.com', + domain: '{YOUR_TENANT}.{YOUR_REGION}.auth0.com', clientId: '{YOUR_CLIENT_ID}', clientSecret: '{YOUR_CLIENT_SECRET}', }); @@ -85,7 +85,7 @@ await auth.oauth.revokeRefreshToken({ import { AuthenticationClient } from 'auth0'; const auth = new AuthenticationClient({ - domain: '{YOUR_TENANT_AND REGION}.auth0.com', + domain: '{YOUR_TENANT}.{YOUR_REGION}.auth0.com', clientId: '{YOUR_CLIENT_ID}', clientSecret: '{YOUR_CLIENT_SECRET}', }); @@ -113,7 +113,7 @@ const { data: tokens } = await auth.oauth.authorizationCodeGrantWithPKCE( import { AuthenticationClient } from 'auth0'; const auth = new AuthenticationClient({ - domain: '{YOUR_TENANT_AND REGION}.auth0.com', + domain: '{YOUR_TENANT}.{YOUR_REGION}.auth0.com', clientId: '{YOUR_CLIENT_ID}', clientSecret: '{YOUR_CLIENT_SECRET}', }); @@ -139,7 +139,7 @@ import { AuthenticationClient } from 'auth0'; const { Agent } = require('undici'); const auth = new AuthenticationClient({ - domain: '{YOUR_TENANT_AND REGION}.auth0.com', + domain: '{YOUR_TENANT}.{YOUR_REGION}.auth0.com', clientId: '{YOUR_CLIENT_ID}', agent: new Agent({ connect: { cert: 'your_cert', key: 'your_key' }, @@ -183,7 +183,7 @@ console.log(token.expires_in); import { ManagementClient } from 'auth0'; const management = new ManagementClient({ - domain: '{YOUR_TENANT_AND REGION}.auth0.com', + domain: '{YOUR_TENANT}.{YOUR_REGION}.auth0.com', clientId: '{YOUR_CLIENT_ID}', clientSecret: '{YOUR_CLIENT_SECRET}', }); @@ -212,7 +212,7 @@ while (true) { import { ManagementClient } from 'auth0'; const management = new ManagementClient({ - domain: '{YOUR_TENANT_AND REGION}.auth0.com', + domain: '{YOUR_TENANT}.{YOUR_REGION}.auth0.com', clientId: '{YOUR_CLIENT_ID}', clientSecret: '{YOUR_CLIENT_SECRET}', }); @@ -236,7 +236,7 @@ import { ManagementClient } from 'auth0'; import { fileFrom } from 'fetch-blob/from.js'; const management = new ManagementClient({ - domain: '{YOUR_TENANT_AND REGION}.auth0.com', + domain: '{YOUR_TENANT}.{YOUR_REGION}.auth0.com', clientId: '{YOUR_CLIENT_ID}', clientSecret: '{YOUR_CLIENT_SECRET}', }); @@ -272,7 +272,7 @@ while (!done) { import { ManagementClient } from 'auth0'; const management = new ManagementClient({ - domain: '{YOUR_TENANT_AND REGION}.auth0.com', + domain: '{YOUR_TENANT}.{YOUR_REGION}.auth0.com', clientId: '{YOUR_CLIENT_ID}', clientSecret: '{YOUR_CLIENT_SECRET}', }); @@ -289,7 +289,7 @@ import https from 'https'; import { ManagementClient } from 'auth0'; const management = new ManagementClient({ - domain: '{YOUR_TENANT_AND REGION}.auth0.com', + domain: '{YOUR_TENANT}.{YOUR_REGION}.auth0.com', clientId: '{YOUR_CLIENT_ID}', clientSecret: '{YOUR_CLIENT_SECRET}', headers: { 'foo': 'applied to all requests' }, @@ -307,7 +307,7 @@ import { ManagementClient } from 'auth0'; import { myFetch } from './fetch'; const management = new ManagementClient({ - domain: '{YOUR_TENANT_AND REGION}.auth0.com', + domain: '{YOUR_TENANT}.{YOUR_REGION}.auth0.com', clientId: '{YOUR_CLIENT_ID}', clientSecret: '{YOUR_CLIENT_SECRET}', async fetch(url, init) { diff --git a/README.md b/README.md index b48d2e2eec..b9f874f80b 100644 --- a/README.md +++ b/README.md @@ -49,13 +49,13 @@ See [more examples](https://github.com/auth0/node-auth0/blob/master/EXAMPLES.md# The Auth0 Management API is meant to be used by back-end servers or trusted parties performing administrative tasks. Generally speaking, anything that can be done through the Auth0 dashboard (and more) can also be done through this API. -Initialize your client class with a client ID, client secret and a domain. +Initialize your client class with a client ID, client secret and a domain. In the Auth0 dashboard, you can find the domain of the Auth0 Management API (System API) within the [General Settings](https://auth0.com/docs/get-started/apis/api-settings#general-settings). ```js import { ManagementClient } from 'auth0'; var management = new ManagementClient({ - domain: '{YOUR_TENANT_AND REGION}.auth0.com', + domain: '{YOUR_TENANT}.{YOUR_REGION}.auth0.com', clientId: '{YOUR_CLIENT_ID}', clientSecret: '{YOUR_CLIENT_SECRET}', }); @@ -67,7 +67,7 @@ Or, initialize your client class with an API v2 token and a domain. import { ManagementClient } from 'auth0'; var management = new ManagementClient({ - domain: '{YOUR_TENANT_AND REGION}.auth0.com', + domain: '{YOUR_TENANT}.{YOUR_REGION}.auth0.com', token: '{YOUR_API_V2_TOKEN}', }); ```