Method: Echosign::Credentials#get_token

Defined in:
lib/echosign/credentials.rb

#get_token(code, redirect_uri) ⇒ String

Make a request to the token endpoint and return an access token



55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/echosign/credentials.rb', line 55

def get_token(code, redirect_uri)
  @client.options[:token_url] = TOKEN_PATH
  oauth_token = @client.get_token(code: code,
                                  redirect_uri: redirect_uri,
                                  grant_type: :authorization_code)

  @access_token = oauth_token.token
  @refresh_token = oauth_token.refresh_token
  @expires_at = oauth_token.expires_at

  return @access_token
end