Created
September 25, 2017 17:58
-
-
Save yum45f/7a3c4efefdfcfa5c17e4918712545eec to your computer and use it in GitHub Desktop.
Ruby Sinatra を使ってGoogle認証をする(実験編)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'bundler' | |
require 'sinatra' | |
require 'omniauth' | |
require 'omniauth-google-oauth2' | |
require './app.rb' | |
use Rack::Session::Cookie, secret: ENV['RACK_COOKIE_SECRET'] | |
use OmniAuth::Builder do | |
provider :google_oauth2, ENV['GOOGLE_KEY'], ENV['GOOGLE_SECRET'], access_type: 'offline', prompt: 'consent', provider_ignores_state: true, scope: 'email,profile' | |
end | |
configure do | |
set :raise_errors, true | |
set :show_exceptions, false | |
end | |
enable :logging | |
run App.new |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment