DEV Community

Gareth Mcshane
Gareth Mcshane

Posted on

A quick auth0/express/heroku setup

first post alert

Every now and then, when I'm going through periods of needing a quick user authentication setup for a poc or mvp, I have to dig out my notes, or find the right blog post, or track down the last repo to refresh my brain.
Then spend time refactoring it to suit the current needs.

I recently had to do this for the umpteenth time so I finally got around to creating a 'bootstrap' method so that I don't have to go through the same rigmarole as before.

I should have done this the first time I had to repeat the process, but was likely being lazy or, paradoxically, in a rush.

It uses Terraform to create an app on heroku, enable the Auth0 addon, and deploy a basic express web-app that is setup with the authentication steps.

Once it's deployed, I can then get straight into development of the product rather than having to start with the auth0 config.

It's super simple:

  1. Create a heroku account (or use existing)
  2. Add a payment method (if you don't already have one)
  3. Update the tfvars with your values
  4. terraform apply -var-file=yourvars.tfvars
  5. Add your heroku url to the auth0 config
  6. profit?

A few more details, screenshots and the like, in the Github Readme: https://github.com/iamgeef/heroku-express-auth0

Thanks
gareth

Top comments (1)

Collapse
 
ben profile image
Ben Halpern

Nice first post!