Auth0 is an authentication broker that supports social identity providers as well as enterprise identity providers such as Active Directory, LDAP, Google Apps, Salesforce.
In this repository, you'll find an API and Web Application that can dynamically generate, at any time, a list of the applications in your Auth0 account and the rules which apply to each application.
- Generate an APIv2 Token with the
Token Generator
in the Auth0 APIv2 explorer. You must add theread:rules
scope to the token. - Create a new application in Auth0 Dashboard.
- If you want the rules list to be only available to a selected whitelist of users:
- Go to Rules Section in Auth0 Dashboard.
- Add rule that will only allow access to users with specific email addresses on this application using this example.
$ npm install
Make sure you change the server/config/auth0.config.js
file with your newly created application settings:
module.exports = {
clientId: 'myClientID',
clientSecret: 'myClientSecret',
domain: 'mydomain.auth0.com',
rulesToken: 'myRulesToken',
};
clientId
: The identifier for the application you've created. This can be found in the settings for your app on Auth0.clientSecret
: The secret for the application you've created. This can be found in the settings for your app on Auth0.domain
: The domain you have from your Auth0 account. This can be found in the settings for your app on Auth0.rulesToken
: The token you generated with the Token Generator (read:rules
scope).
If you want to view the rules list from the Web Application make sure you change the client/app/core/constants.js
file with your newly created application settings:
angular
.module('app')
.constant('auth0Config', {
clientId: 'myClientID',
domain: 'mydomain.auth0.com',
})
.constant('apiUrl', 'http://localhost:3000')
.constant('rulesListCloseOthers', false);
clientId
: The identifier for the application you've created. This can be found in the settings for your app on Auth0.domain
: The domain you have from your Auth0 account. This can be found in the settings for your app on Auth0.apiUrl
: The endpoint of the auth0 rules list server [Default: http://localhost:3000]rulesListCloseOthers
: Control whether expanding a application rules list will cause the others to close.
$ cd server
$ node bin/www
This endpoint is protected by Auth0 authentication.
Example: http://localhost:3000/api/list
Access via:
http://localhost:3000/
Example: