Skip to content

Webtask Deployment

Cristofer Gonzales edited this page May 2, 2016 · 3 revisions

This document will explain you how to build locally the application and run it in a webtask.io server, if you are only interested in running the applicatio AS-IS in webtask visit this [page](Webtask Git Deployment)

Setup

  1. Get the latest version of the code to your machine

    git clone https://github.com/CriGoT/auth0-update-email.git
    
  2. Initialize the solution

    npm install
    
  3. Create the bundled version of the application. This command will consolidate all resources and apply the required transformations to the application

    npm run bundle
    
  4. Check that the file build/bundle.wt.js exists.

Initialize the Webtask Container

Webtask.io is platform that allows developers to run code in a secure isolated environment.

All Auth0 tenants have access to a Webtask container that they can use to deploy their extensions and it also can be used to run other applications. In the following steps we will use that container to deploy the Self-Service E-mail Update application.

if you don't want to use your Auth0 webtask tenant you can also create a container of your own. Follow the instructions here and skip this section

  1. Access the Account > Webtasks section of your Auth0 tenant.

  2. Follow the first two steps of the page. Be careful with the token since it enables any user to create Webtasks in your container.

Create the Webtask

Before creating the command make sure you have all the information collected while [preparing the tenant](Prepare your Auth0 tenant)

  1. Execute the following command replacing the values of the secrets and the name of the webtask if you want to.

    wt create --name *eu* --no-merge --no-parse --prod --secret AUTH0_DOMAIN=**Application Domain** --secret AUTH0_MANAGEMENT_TOKEN=**JWT Token** --secret AUTH0_CLIENT_ID=**Application Client ID** --secret AUTH0_CLIENT_SECRET=**Application Client Secret** --secret AUTH0_CONNECTION=**Application Connection Name** build/bundle.wt.js
    
  2. Once the command completes it will display the url that you can use to access the application, copy it for the next process.

    Webtask created
    You can access your webtask at the following url:
    https://webtask.it.auth0.com/api/run/.../eu
    

Register callback in Auth0

To succesfully run the application there is on additional step. You must register the webtask URL as a callback for the application

The steps required to register the callback can be found [here](Register Callback)

Clone this wiki locally