orbit-4-2/lib/omniauth/strategies/doorkeeper.rb

26 lines
491 B
Ruby
Raw Permalink Normal View History

2014-02-11 10:14:45 +00:00
module OmniAuth
module Strategies
class Doorkeeper < OmniAuth::Strategies::OAuth2
option :name, :doorkeeper
option :client_options, {
:site => "http://localhost:8000",
:authorize_path => "/oauth/authorize"
}
uid do
raw_info["id"]
end
info do
{
:email => raw_info["email"]
}
end
def raw_info
@raw_info ||= access_token.get('/api/v1/me.json').parsed
end
end
end
end