Module: Instagram::OAuth
- Included in:
- API
- Defined in:
- lib/instagram/oauth.rb
Overview
Defines HTTP request methods
Instance Method Summary collapse
-
#authorize_url(options = {}) ⇒ Object
Return URL for OAuth authorization.
-
#get_access_token(code, options = {}) ⇒ Object
Return an access token from authorization.
Instance Method Details
#authorize_url(options = {}) ⇒ Object
Return URL for OAuth authorization
5 6 7 8 9 |
# File 'lib/instagram/oauth.rb', line 5 def (={}) [:response_type] ||= "code" params = access_token_params.merge() connection.build_url("/oauth/authorize/", params).to_s end |
#get_access_token(code, options = {}) ⇒ Object
Return an access token from authorization
12 13 14 15 16 |
# File 'lib/instagram/oauth.rb', line 12 def get_access_token(code, ={}) [:grant_type] ||= "authorization_code" params = access_token_params.merge() post("/oauth/access_token/", params.merge(:code => code), raw=false, unformatted=true) end |