ruby实现github第三方认证
代码很简单,这里就不多废话了
#coding: utf-8 require 'sinatra' require 'omniauth' require 'omniauth-github' use Rack::Session::Cookie use OmniAuth::Builder do provider :github, 'b478ae6b31dd730b20d1','89f67d361fb348c959eaafea7e40f6db8b166366' end get '/' do <<-HTML <a href='/auth/github'>Sign in with github</a> HTML end post '/auth/:name/callback' do auth = require.env['omniauth.auth'] end
以上所述就是本文的全部内容了,希望大家能够喜欢。
相关推荐
lei0 2020-11-02
webgm 2020-08-16
igogo00 2020-07-04
iconhot 2020-06-26
88481456 2020-06-18
疯狂紫萧 2020-06-16
yezitoo 2020-06-06
SelinaChan 2020-05-15
luckymaoyy 2020-04-25
80437700 2020-04-17
austindev 2020-04-07
我有一只小松鼠 2020-02-29
webfullStack 2020-02-15
binglingnew 2012-10-03
始作俑者 2020-01-19
jinxiutong 2020-01-04
Dawnworld 2019-12-23
yezitoo 2019-12-05