Class: Boar::Providers::BoxNet
- Inherits:
-
Base
- Object
- Base
- Boar::Providers::BoxNet
show all
- Defined in:
- lib/boar/providers/box_net.rb
Instance Method Summary
collapse
Methods inherited from Base
#search_file, #update_credentials
Instance Method Details
#get_credentials(authorizer, request, response) ⇒ Object
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/boar/providers/box_net.rb', line 15
def get_credentials(authorizer, request, response)
begin
raise Clavem::Exceptions::AuthorizationDenied if request.query["error"].present?
token = @session.get_access_token(request.query["code"])
{access_token: token.token, refresh_token: token.refresh_token}
rescue RuntimeError
nil
end
end
|
#redirect_for_authentication(authorizer, configuration) ⇒ Object
10
11
12
13
|
# File 'lib/boar/providers/box_net.rb', line 10
def redirect_for_authentication(authorizer, configuration)
@session = RubyBox::Session.new({client_id: configuration[:client_id], client_secret: configuration[:client_secret]})
@session.authorize_url(authorizer.callback_url)
end
|