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.json
topublic/config.json
, and make appropriate modifications there. npm run frontend
- Update base tag's href value in
public/index.html
according to where frontend app would live. If on github pages, then that URI, ENDING IN A TRAILING SLASH. git add public
git commit -m "Deploy frontend"
git push && git subtree push --prefix public origin gh-pages
git 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_token
and 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.js
calls 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
webtaskToken
by putting in the result ofwt profile ls --show-token
inconfig.json
. - Next, run
npm run deploy-webtask
to deploy the node backend.
2: Other Cloud Environments (Docker build coming soon).
- Clone this rep.
- Run
npm install --production
in the directory. - Run the node process as you would do:
node ./
.