class SparkApi::Authentication::OAuth2Impl::GrantTypeRefresh
Attributes
params[RW]
Public Class Methods
new(client, provider, session)
click to toggle source
Calls superclass method
SparkApi::Authentication::OAuth2Impl::GrantTypeBase::new
# File lib/spark_api/authentication/oauth2_impl/grant_type_refresh.rb, line 7 def initialize(client, provider, session) super(client, provider, session) @params = {} end
Public Instance Methods
authenticate()
click to toggle source
# File lib/spark_api/authentication/oauth2_impl/grant_type_refresh.rb, line 12 def authenticate new_session = nil unless @session.refresh_token.nil? SparkApi.logger.debug { "[oauth2] Refreshing authentication to #{provider.access_uri} using [#{session.refresh_token}]" } new_session = create_session(token_params) end new_session end
Private Instance Methods
token_params()
click to toggle source
# File lib/spark_api/authentication/oauth2_impl/grant_type_refresh.rb, line 22 def token_params hash = @params.merge({ "client_id" => @provider.client_id, "client_secret" => @provider.client_secret, "grant_type" => "refresh_token", "refresh_token"=> session.refresh_token, }) MultiJson.dump(hash) end