Rails Authentication
Ruby gem for authentication in a rails app
Creating a new Rails app
- Use Repository Dashboard to create a new repository
with the rails-template.
- 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' - 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.
- If you did not use the rails-template from Repository Dashboard, you will need to add the following to your Gemfile:
- Navigate to the repo folder in a terminal and execute
rails g strongmind:install - 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 - Create a new client in stage identity server and
IDENTITY_CLIENT_IDandIDENTITY_CLIENT_SECRETvalues to .env file. - Create a new client in prod identity server and
IDENTITY_CLIENT_IDandIDENTITY_CLIENT_SECRETvalues to .env file. - Execute
rails dev:cacheto turn on caching in development. - Execute
bin/dev