Class: Oauth::Provider
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Oauth::Provider
- Defined in:
- app/models/oauth/provider.rb
Instance Method Summary collapse
- #authorize_url(params = {}) ⇒ Object
- #redeem_access_token(code, params = {}) ⇒ Object
- #refresh_access_token(authorization) ⇒ Object
Instance Method Details
#authorize_url(params = {}) ⇒ Object
7 8 9 |
# File 'app/models/oauth/provider.rb', line 7 def (params={}) client.auth_code. params.merge(redirect_uri: oauth2_callback_url) end |
#redeem_access_token(code, params = {}) ⇒ Object
11 12 13 |
# File 'app/models/oauth/provider.rb', line 11 def redeem_access_token(code, params={}) client.auth_code.get_token(code, params.merge(redirect_uri: oauth2_callback_url)) end |
#refresh_access_token(authorization) ⇒ Object
15 16 17 |
# File 'app/models/oauth/provider.rb', line 15 def refresh_access_token() OAuth2::AccessToken.from_hash(client, .attributes).refresh! end |