/auth0_rails_api

A simple API build with Rails 6 and secured with Auth0.

Primary LanguageRuby

README

This repository accompanies the Auth0 blog post on building secure APIs with Rails 6 and Auth0.

Setup

Before running the app, you first need to generate a credentials file with an Auth0 API identifier and your Auth0 domain. See the above linked blog post if you need further clarification.

$ bundle install
$ bundle exec rails credentials:edit --environment development

Add the following to the credentials file, replacing {API_IDENTIFIER} and {AUTH0_DOMAIN} with your own values:

auth0:
  api_identifier: {API_IDENTIFIER}
  domain: {AUTH0_DOMAIN}

Run

$ bundle exec rails server