Sha256: cf93573cd12f06c0de4798c8406687c915a00ba6b8ea8b890ea25702d7ddebdd

Contents?: true

Size: 1.39 KB

Versions: 32

Compression:

Stored size: 1.39 KB

Contents

#Auth0 + Ruby on Rails API Seed

This is the seed project you need to use if you're going to create a Ruby on Rails API. You'll mostly use this API either for a SPA or a Mobile app. If you just want to create a Regular Ruby on Rails WebApp, please check this [other seed project](https://github.com/auth0/omniauth-auth0)

This example is deployed at Heroku at http://auth0-rorapi-sample.herokuapp.com/ping

#Running the example

In order to run the example you need to have ruby installed.

You also need to set the ClientSecret and ClientId for your Auth0 app as enviroment variables with the following names respectively: AUTH0_CLIENT_SECRET and AUTH0_CLIENT_ID.

For that, if you just create a file named .env in the directory and set the values like the following, the app will just work:

````bash
# .env file
AUTH0_CLIENT_SECRET=myCoolSecret
AUTH0_CLIENT_ID=myCoolClientId
````

Once you've set those 2 enviroment variables, run `bundle install`, then run `rails s` and try calling [http://localhost:3000/ping](http://localhost:3000/ping)

You can then try to do a GET to [http://localhost:3000/secured/ping](http://localhost:3000/secured/ping) which will throw an error if you don't send the JWT in the header.

__Note:__ if you need to enable cross-origin resource sharing, check out the [rack-cors](https://github.com/cyu/rack-cors) gem.

__Note:__ if you are using Windows, add the `tzinfo-data` gem to the gemfile.

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
auth0-5.10.0 examples/ruby-on-rails-api/README.md
auth0-5.9.0 examples/ruby-on-rails-api/README.md
auth0-5.8.1 examples/ruby-on-rails-api/README.md
auth0-5.8.0 examples/ruby-on-rails-api/README.md
auth0-5.7.0 examples/ruby-on-rails-api/README.md
auth0-5.6.1 examples/ruby-on-rails-api/README.md
auth0-5.6.0 examples/ruby-on-rails-api/README.md
auth0-5.5.0 examples/ruby-on-rails-api/README.md
auth0-5.4.0 examples/ruby-on-rails-api/README.md
auth0-5.3.0 examples/ruby-on-rails-api/README.md
auth0-5.2.0 examples/ruby-on-rails-api/README.md
auth0-5.1.2 examples/ruby-on-rails-api/README.md
auth0-5.1.1 examples/ruby-on-rails-api/README.md
auth0-5.1.0 examples/ruby-on-rails-api/README.md
auth0-5.0.1 examples/ruby-on-rails-api/README.md
auth0-5.0.0 examples/ruby-on-rails-api/README.md
auth0-4.17.1 examples/ruby-on-rails-api/README.md
auth0-4.17.0 examples/ruby-on-rails-api/README.md
auth0-4.16.0 examples/ruby-on-rails-api/README.md
auth0-4.15.0 examples/ruby-on-rails-api/README.md