Class: OmniAuth::Strategies::AmazonSpApi
- Inherits:
-
OAuth2
- Object
- OAuth2
- OmniAuth::Strategies::AmazonSpApi
- Defined in:
- lib/omniauth/strategies/amazon-sp-api.rb
Instance Attribute Summary collapse
-
#mws_auth_token ⇒ Object
readonly
Returns the value of attribute mws_auth_token.
-
#selling_partner_id ⇒ Object
readonly
Returns the value of attribute selling_partner_id.
Instance Method Summary collapse
Instance Attribute Details
#mws_auth_token ⇒ Object (readonly)
Returns the value of attribute mws_auth_token.
6 7 8 |
# File 'lib/omniauth/strategies/amazon-sp-api.rb', line 6 def mws_auth_token @mws_auth_token end |
#selling_partner_id ⇒ Object (readonly)
Returns the value of attribute selling_partner_id.
6 7 8 |
# File 'lib/omniauth/strategies/amazon-sp-api.rb', line 6 def selling_partner_id @selling_partner_id end |
Instance Method Details
#build_access_token ⇒ Object
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/omniauth/strategies/amazon-sp-api.rb', line 30 def build_access_token verifier = request.params['spapi_oauth_code'] client.auth_code.get_token( verifier, { redirect_uri: callback_url }.merge( token_params.to_hash(symbolize_keys: true) ), deep_symbolize(.auth_token_params) ) end |
#callback_phase ⇒ Object
24 25 26 27 28 |
# File 'lib/omniauth/strategies/amazon-sp-api.rb', line 24 def callback_phase @selling_partner_id = request.params['selling_partner_id'] @mws_auth_token = request.params['mws_auth_token'] super end |
#callback_url ⇒ Object
41 42 43 |
# File 'lib/omniauth/strategies/amazon-sp-api.rb', line 41 def callback_url [:redirect_uri] || full_host + script_name + callback_path end |