GET /api/rules: Uses Auth0 Mangement APIv2 to get aRulesContext, where the context is defined as:
Array({
clientName: String,
clientId : String,
rules : Array({
ruleId : String,
ruleScript : String
})
})GET /api/invalid-rules: Uses Auth0 Management APIv2 to get aRulesContext(similar to above), with the difference that only those rules are reported that have acontext.clientId ===orcontext.clientName ===proceeded by an invalid id or name, one that does not exist under your Auth0 tenant.
I suggest you use Github pages or similar. You would need to bundle the app like so:
- Copy
public/sample-config.jsontopublic/config.json, and make appropriate modifications there. npm run frontend- Update base tag's href value in
public/index.htmlaccording to where frontend app would live. If on github pages, then that URI, ENDING IN A TRAILING SLASH. git add publicgit commit -m "Deploy frontend"git push && git subtree push --prefix public origin gh-pagesgit checkout gh-pages- Add symlinks so this app can work with Github Pages. Add, commit and push again.
ln -s index.html 404.html
ln -s index.html dashboard.html
ln -s index.html callback.html
touch .nojekyll
git add *.html
git add .nojekyll
git commit -m "Add symlinks to work with SPA"
git push
- You would need 1 non interactive client in Auth0 that this API would use to access the Management APIv2.
- You would need a custom API defined in the dashboard. This API would be used to refer to this custom app api itself. For this API, I highly recommend using RS256 cryptography.
- You would need a test client of the custom API. This should be auto-created for you when the API is created.
- Angular frontend app authenticates against this API, and gets
access_tokenand such. - The frontend app uses these tokens with bearer authorization to get the
RulesContext(as defined above). - In the background, the custom api written in
node.jscalls the Management APIv2, assembles and sends all the results. - The angular app displays these results in a useable manner.
Copy sample-config.json to a file called config.json (NOT TO be confused with the file of same name under public), and supply all pertinent values. The audienceClaim
refers to the audience value for this customer api itself, as defined in Auth0 dashboard.
1: Webtask Note that any mention of webpack and its build configuration is only supplied for running on webtask:
- Supply your
webtaskTokenby putting in the result ofwt profile ls --show-tokeninconfig.json. - Next, run
npm run deploy-webtaskto deploy the node backend.
2: Other Cloud Environments (Docker build coming soon).
- Clone this rep.
- Run
npm install --productionin the directory. - Run the node process as you would do:
node ./.