Magento 2 – Where Does the OAuth Verifier Token Come From?

integrationmagento2oauth

Per the developer documentation, when making a request for an access token, you need to include a verifier token

oauth_verifier. The verification code that is tied to the consumer and request token.

However, there's nothing in the documentation that mentions where this verifier token comes from. I would presume it comes from the request for an access token, but the documentation doesn't reflect this.

Hoping somewhere here knows the answer ans saves me the headache of tracing out the oAuth process

Best Answer

Think I've got this one figured out. When you authorize an integration, Magento makes a POST to the integration's callback URL. This information includes the verifier token.

Called Array
(
    [oauth_consumer_key] => 2unvs7ccym............77kvlxx1rp
    [oauth_consumer_secret] => 1skp6............yy842a49xrjkaqb
    [store_base_url] => http://magento-2-0-4.dev/
    [oauth_verifier] => ku8wjnqxuxj98x0ruwf............4
)

Tangentially -- as the client/app owner, you use the consumer key and consumer secret to POST to /oauth/token/request and get a request token and a request token secret. You use the request token along with the oauth verifier when you request a access token from /oauth/token/access. The request token secret is not used directly, but it is used indirectly. The secret is used to sign the request made to /oauth/token/access.

Related Topic