Module: FidorApi::Auth
Instance Method Summary collapse
Instance Method Details
#authorize_url ⇒ Object
6 7 8 |
# File 'lib/fidor_api/auth.rb', line 6 def end |
#fetch_token(code) ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/fidor_api/auth.rb', line 10 def fetch_token(code) response = connection.post "/oauth/token", { client_id: FidorApi.configuration.client_id, redirect_uri: FidorApi.configuration.callback_url, code: code, grant_type: "authorization_code" } Token.new JSON.parse(response.body) end |
#refresh_token(token) ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/fidor_api/auth.rb', line 20 def refresh_token(token) response = connection.post "/oauth/token", { grant_type: "refresh_token", refresh_token: token.refresh_token } Token.new JSON.parse(response.body) end |