2021-04-01 18:01:51 +08:00
|
|
|
module EducoderOauth
|
|
|
|
class << self
|
2021-04-02 09:43:18 +08:00
|
|
|
attr_accessor :client_id, :client_secret, :base_url, :redirect_uri
|
2021-04-01 18:01:51 +08:00
|
|
|
|
|
|
|
def logger
|
|
|
|
@_logger ||= STDOUT
|
|
|
|
end
|
|
|
|
|
|
|
|
def logger=(l)
|
|
|
|
@_logger = l
|
|
|
|
end
|
|
|
|
|
2021-04-02 09:43:18 +08:00
|
|
|
def oauth_url
|
2021-04-01 18:01:51 +08:00
|
|
|
"#{base_url}/oauth2?call_url=/oauth/authorize?client_id=#{client_id}&redirect_uri=#{URI.encode_www_form_component(redirect_uri)}&response_type=code"
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|