Skip to content

Instantly share code, notes, and snippets.

@sandrinodimattia
Last active November 17, 2016 19:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sandrinodimattia/06956b1b923b94a368128e6d4f52e816 to your computer and use it in GitHub Desktop.
Save sandrinodimattia/06956b1b923b94a368128e6d4f52e816 to your computer and use it in GitHub Desktop.
Installing the Authorization Extension Beta

This document explains how you can test the new authorization extension in a US account. Keep into account that, once available in the Extension Gallery, all these steps will not be required.

Configure Webtask

Go to this page and follow the steps to connect to your webtask account: https://manage.auth0.com/#/account/webtasks

Configure your Auth0 Account

Start by creating a new client: https://manage.auth0.com/#/clients

Authorize the client for the Auth0 Management API here: https://manage.auth0.com/#/apis

Finally, grant it the following scopes:

  • read/create/update/delete Resource Servers
  • read/create/update/delete Clients
  • read Users

Copy the Client ID and Secret to the next step.

Deploy the Extension

Note: Replace AUTH0_TENANT here with the name of your Auth0 tenant (without the .auth0.com suffix).

export AUTH0_TENANT=sandrino-dev
export AUTH0_CLIENT_ID=xxx
export AUTH0_CLIENT_SECRET=xxx
export EXTENSION_SECRET=$(openssl rand -base64 32)

curl https://raw.githubusercontent.com/auth0/auth0-authorization-extension/dev/build/bundle.js > bundle.js

wt create ./bundle.js \
    --no-parse --no-merge --name auth0-authz \
    --profile $AUTH0_TENANT-default \
    --secret WT_URL=https://$AUTH0_TENANT.us.webtask.io/auth0-authz/ \
    --secret EXTENSION_SECRET=$EXTENSION_SECRET \
    --secret AUTH0_CLIENT_ID=$AUTH0_CLIENT_ID \
    --secret AUTH0_CLIENT_SECRET=$AUTH0_CLIENT_SECRET \
    --secret AUTH0_DOMAIN=$AUTH0_TENANT.auth0.com \
    --secret AUTH0_RTA="auth0.auth0.com"

Update the Extension

If you find an issue and we patch the beta version, here's how you can update your extension:

export AUTH0_TENANT=sandrino-dev

curl https://raw.githubusercontent.com/auth0/auth0-authorization-extension/dev/build/bundle.js > bundle.js
wt update auth0-authz ./bundle.js --profile $AUTH0_TENANT-default

Use the Extension

Go to https://your-tenant.us.webtask.io/auth0-authz/login?webtask_no_cache=1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment