Skip to content
This repository has been archived by the owner on Aug 10, 2021. It is now read-only.

Latest commit

 

History

History
75 lines (62 loc) · 1.95 KB

devnotes.rdoc

File metadata and controls

75 lines (62 loc) · 1.95 KB

Development Note

Install and Setup Basement

initialize app tree/repository

$ rails new siso-client --skip-bundle; cd siso-client
<...>
$ git init; git add .; git commit -m "new rails app 'siso-client'."
<...>
$ git remote add origin git@github.com:hyeoncheon/siso-client.git
$ git push -u origin master
<...>

bundle gems.

$ cat >>Gemfile<<EOF
> 
> ### local gems
> gem 'omniauth-oauth2'
> EOF
$ bundle install --path=$HOME/.gem
<...>

setup omniauth for SiSO

$ cat >>config/initializers/omniauth.rb<<EOF
> require 'omniauth-siso'
>
> Rails.application.config.middleware.use OmniAuth::Builder do
>   provider :siso, SISO_APP_ID, SISO_APP_SECRET, :client_options => {:site => SISO_APP_URL}
> end
> EOF
$ cat >> config/environments/development.rb <<EOF
> 
> SISO_APP_ID = "SISO_APP_ID"
> SISO_APP_SECRET = "SISO_APP_SECRET"
> SISO_APP_URL = "SISO_APP_URL"
> EOF
$ cat >> config/environments/production.rb <<EOF
>
> SISO_APP_ID = "SISO_APP_ID"
> SISO_APP_SECRET = "SISO_APP_SECRET"
> SISO_APP_URL = "SISO_APP_URL"
> EOF
$ mkdir -p lib/omniauth/strategies lib/omniauth/siso
$ vi lib/omniauth-siso.rb
$ vi lib/omniauth/siso.rb
$ vi lib/omniauth/siso/version.rb
$ vi lib/omniauth/strategies/siso.rb

edit config/route.rb

match '/auth/:provider/callback', :to => 'sessions#create'

generate default session controller.

$ rails g controller sessions
Faraday: you may want to install system_timer for reliable timeouts
     create  app/controllers/sessions_controller.rb
     invoke  erb
     create    app/views/sessions
     invoke  test_unit
     create    test/functional/sessions_controller_test.rb
     invoke  helper
     create    app/helpers/sessions_helper.rb
     invoke    test_unit
     create      test/unit/helpers/sessions_helper_test.rb
     invoke  assets
     invoke    coffee
     create      app/assets/javascripts/sessions.js.coffee
     invoke    scss
     create      app/assets/stylesheets/sessions.css.scss