Rails Authentication

Ruby gem for authentication in a rails app

Creating a new Rails app

  1. Use Repository Dashboard to create a new repository with the rails-template.
    1. If you did not use the rails-template from Repository Dashboard, you will need to add the following to your Gemfile: ruby gem "strongmind-platform-sdk" gem 'font-awesome-rails' gem 'devise' gem 'omniauth' gem 'omniauth_openid_connect' gem 'omniauth-rails_csrf_protection' gem 'dotenv-rails' gem 'sentry-rails'
    2. If you want to use the common navbar you will also need to go to section 5 and 6 in the existing application doc and follow the instructions there after running the generator in step 2.
  2. Navigate to the repo folder in a terminal and execute rails g strongmind:install
  3. Move app root to authenticated root in routes. Should look like this: ruby authenticated :user do root to: 'home#index' # or whatever makes sense for your app end
  4. Create a new client in stage identity server and IDENTITY_CLIENT_ID and IDENTITY_CLIENT_SECRET values to .env file.
  5. Create a new client in prod identity server and IDENTITY_CLIENT_ID and IDENTITY_CLIENT_SECRET values to .env file.
  6. Execute rails dev:cache to turn on caching in development.
  7. Execute bin/dev