require 'oauth2' # google の認可サーバにリクエスト def authorization client = OAuth2::Client.new( CLIENT_ID, CLIENT_SECRET, { site: 'https://accounts.google.com/', authorize_url: 'o/oauth2/auth', } ) redirect_to client.auth_code.authorize_url( redirect_uri: 'http://localhost:8080/oauth/callback', scope: SCOPE_CODE, # see about scopes: https://developers.google.com/identity/protocols/googlescopes ) end # パラメータ
