Class: IntuitOAuth::Flow::AuthCode
- Defined in:
- lib/intuit-oauth/flow/code.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#get_auth_uri(scopes, state_token = nil) ⇒ URL
Generate the Authorization Code URL.
Methods inherited from Base
Constructor Details
This class inherits a constructor from IntuitOAuth::Base
Instance Method Details
#get_auth_uri(scopes, state_token = nil) ⇒ URL
Generate the Authorization Code URL
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/intuit-oauth/flow/code.rb', line 29 def get_auth_uri(scopes, state_token=nil) if state_token.nil? state_token = IntuitOAuth::Utils.generate_random_string() end @client.state_token = state_token url_params = { client_id: @client.id, scope: IntuitOAuth::Utils.scopes_to_string(scopes), redirect_uri: @client.redirect_uri, response_type: 'code', state: state_token, } "#{@client.auth_endpoint}?#{url_params.to_param}" end |