3 navsection: installguide
4 title: Install Single Sign On (SSO) server
7 h2(#dependencies). Install dependencies
9 Make sure you have "Ruby and Bundler":install-manual-prerequisites-ruby.html installed.
11 h2(#install). Install SSO server
13 h3. Get SSO server code and create database
16 <pre><code>~$ <span class="userinput">cd $HOME</span> # (or wherever you want to install)
17 ~$ <span class="userinput">git clone https://github.com/curoverse/sso-devise-omniauth-provider.git</span>
18 ~$ <span class="userinput">cd sso-devise-omniauth-provider</span>
19 ~/sso-devise-omniauth-provider$ <span class="userinput">bundle install</span>
20 ~/sso-devise-omniauth-provider$ <span class="userinput">RAILS_ENV=production bundle exec rake db:create</span>
21 ~/sso-devise-omniauth-provider$ <span class="userinput">RAILS_ENV=production bundle exec rake db:migrate</span>
25 h3. Configure Rails secret
30 <pre><code>~/sso-devise-omniauth-provider$ <span class="userinput">cp -i config/initializers/secret_token.rb.example config/initializers/secret_token.rb</span>
31 ~/sso-devise-omniauth-provider$ <span class="userinput">rake secret</span>
32 zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
36 Edit @config/initializers/secret_token.rb@ to set @config.secret_token@ to the string produced by @rake secret@.
38 h3. Configure upstream authentication provider
41 <pre><code>~/sso-devise-omniauth-provider$ <span class="userinput">cp -i config/environments/production.rb.example config/environments/production.rb</span>
45 Edit @config/environments/production.rb@ to set @config.google_oauth2_client_id@ and @config.google_oauth2_client_secret@. See "Omniauth Google OAuth2 gem documentation":https://github.com/zquestz/omniauth-google-oauth2 and "Using OAuth 2.0 to Access Google APIs":https://developers.google.com/accounts/docs/OAuth2 for information about using the "Google Developers Console":https://console.developers.google.com to get a Google client id and client secret.
47 h3(#client). Create arvados-server client
49 Use @rails console@ to create a @Client@ record that will be used by the Arvados API server. The values of @app_id@ and @app_secret@ correspond to the @APP_ID@ and @APP_SECRET@ that must be set in in "Setting up Omniauth in the API server.":install-api-server.html#omniauth
52 <pre><code>~/sso-devise-omniauth-provider$ <span class="userinput">rake secret</span>
53 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
54 ~/sso-devise-omniauth-provider$ <span class="userinput">RAILS_ENV=production bundle exec rails console</span>
55 irb(main):001:0> <span class="userinput">c = Client.new</span>
56 irb(main):002:0> <span class="userinput">c.name = "joshid"</span>
57 irb(main):003:0> <span class="userinput">c.app_id = "arvados-server"</span>
58 irb(main):004:0> <span class="userinput">c.app_secret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"</span>
59 irb(main):005:0> <span class="userinput">c.save!</span>
60 irb(main):006:0> <span class="userinput">quit</span>
64 h2. Start the SSO server
66 h3. Run a simple standalone server
68 You can use the Webrick server that is bundled with Ruby to quickly verify that your installation is functioning:
71 <pre><code>~/arvados/services/api$ <span class="userinput">RAILS_ENV=production bundle exec rails server</span>
75 h3. Production environment
77 As a Ruby on Rails application, the SSO server should be compatible with any Ruby application server that supports Rack applications. We recommend "Passenger":https://www.phusionpassenger.com/ to run the SSO server in production.