ruby实现github第三方认证
程序员文章站
2022-04-09 20:21:28
代码很简单,这里就不多废话了
#coding: utf-8
require 'sinatra'
require 'omniauth'
require 'om...
代码很简单,这里就不多废话了
#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
以上所述就是本文的全部内容了,希望大家能够喜欢。