node-auth0
+ Node.js client library for the Auth0 platform. You can find this library documentation in this page. You can find this library documentation in this page. For more information about auth0 check our documentation page. This client must be used to access Auth0's Authentication API. This client must be used to access Auth0's Authentication API. The AuthenticationClient constructor takes an optional client ID, if specified it will be used as default value for all endpoints that accept a client ID. 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. 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 an API v2 token and a domain. Note: When using at browser you should use To obtain automatically a Management API token via the ManagementClient, you can specify the parameters This client must be used to access Auth0's
clientId: '{YOUR_NON_INTERACTIVE_CLIENT_ID}',
clientSecret: '{YOUR_NON_INTERACTIVE_CLIENT_SECRET}',
scope: 'read:users update:users'
-}); Make sure your ClientId is allowed to request tokens from Management API in Auth0 Dashboard To obtain a Management API token from your node backend, you can use Client Credentials Grant using your registered Auth0 Non Interactive Clients This client must be used to access Auth0's
}
console.log(response.access_token);
}
-); Also you can request a token when the user authenticates using any of our client side SDKs, e.g. auth0.js. Be aware that all methods can be used with promises or callbacks. However, when a callback is provided no promise will be returned. Also you can request a token when the user authenticates using any of our client side SDKs, e.g. auth0.js. Be aware that all methods can be used with promises or callbacks. However, when a callback is provided no promise will be returned. Be aware that all methods can be used with pro
})
.catch(function(err) {
// Handle error.
- }); Auth0 helps you to: Auth0 helps you to: Be aware that all methods can be used with pro
If you have found a bug or if you have a feature request, please report them at this repository issues section. Please do not report security vulnerabilities on the public GitHub issue tracker. The Responsible Disclosure Program details the procedure for disclosing security issues. This project is licensed under the MIT license. See the LICENSE file for more info. If you have found a bug or if you have a feature request, please report them at this repository issues section. Please do not report security vulnerabilities on the public GitHub issue tracker. The Responsible Disclosure Program details the procedure for disclosing security issues. This project is licensed under the MIT license. See the LICENSE file for more info.node-auth0
+
Installation
npm install auth0
Documentation
Installation
+
+ npm install auth0
+
Documentation
+Authentication API Client
Authentication API Client
+var AuthenticationClient = require('auth0').AuthenticationClient;
var auth0 = new AuthenticationClient({
domain: '{YOUR_ACCOUNT}.auth0.com',
clientId: '{OPTIONAL_CLIENT_ID}'
-});
Management API Client
Management API Client
+var ManagementClient = require('auth0').ManagementClient;
var management = new ManagementClient({
token: '{YOUR_API_V2_TOKEN}',
domain: '{YOUR_ACCOUNT}.auth0.com'
-});
+});
+
+
telemetry: false
.clientId
, clientSecret
(use a Non Interactive Client) and optionally scope
.
@@ -81,7 +92,9 @@ Authentication API Client
+});
+
+
Authentication API Client
Promises and callbacks
Promises and callbacks
+// Using callbacks.
management.getUsers(function(err, users) {
if (err) {
@@ -122,7 +138,10 @@
Promises and callbacks
What is Auth0?
What is Auth0?
+
-Promises and callbacks
Create a free Auth0 Account
+
Create a free Auth0 Account
+
-Issue Reporting
Author
-License
Issue Reporting
+Author
+
+License
+