cancel
Showing results for 
Search instead for 
Did you mean: 

Magento2 not receiving oauth data for callback url during integration

SOLVED

Magento2 not receiving oauth data for callback url during integration

Hey
I'm trying to create an integration but the callback_url isn't receiving any data for the oauth as mentioned in the documentation (image1). I'm however receiving the data for the Identity link URL.

I have tried removing the data from the oauth_token table,flush the cache from admin,still not working.

I am using ngrok for connecting localhost url, both the callback and identity_url have the same ngrok url with different endpoints,the identity does route to frontend later in the code as i need some other data from frontend.

Need help
Thanks

image1:
Screenshot from 2025-01-31 19-06-32.png

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Magento2 not receiving oauth data for callback url during integration

Hello @manishcybebb58,

 

If your OAuth callback URL in Magento 2 is not receiving data during integration, but the Identity Link URL is working then Magento 2 OAuth flow sends the oauth_verifier only after the user approves the integration request in the Magento admin. If the user hasn't approved the request yet, the callback URL won't receive data.

 

  •   Go to System > Extensions > Integrations in Magento Admin.
  •   Check if the integration is in Pending state.
  •   Click Authorize and check if the callback URL is triggered.

 

Magento 2 might not be correctly recognizing your callback URL. Ensure the URL is correctly set:

Check your Integration Settings under:

 

System > Extensions > Integrations > Your Integration > Edit

Ensure that:

  • The Callback URL is the exact URL where you expect OAuth data.
  • The URL is publicly accessible via ngrok (Magento might fail if it detects localhost).
  • Both the Identity Link URL and Callback URL are using https.

You mentioned clearing the oauth_token table, but try it again with a full refresh:

DELETE FROM oauth_token WHERE consumer_id IN (SELECT consumer_id FROM oauth_consumer WHERE name='YourIntegrationName');

 

you may need to clear the Magento cache also after clearing the oauth_token table entries.

 

If the issue will be resolved, Click Kudos & Accept as a Solution.

View solution in original post

3 REPLIES 3

Re: Magento2 not receiving oauth data for callback url during integration

Sounds frustrating! Maybe check if the callback URL is correctly set in Magento2's integration settings, kind of like double-checking ingredients in Texan Recipes before cooking.

Re: Magento2 not receiving oauth data for callback url during integration

Hello @manishcybebb58,

 

If your OAuth callback URL in Magento 2 is not receiving data during integration, but the Identity Link URL is working then Magento 2 OAuth flow sends the oauth_verifier only after the user approves the integration request in the Magento admin. If the user hasn't approved the request yet, the callback URL won't receive data.

 

  •   Go to System > Extensions > Integrations in Magento Admin.
  •   Check if the integration is in Pending state.
  •   Click Authorize and check if the callback URL is triggered.

 

Magento 2 might not be correctly recognizing your callback URL. Ensure the URL is correctly set:

Check your Integration Settings under:

 

System > Extensions > Integrations > Your Integration > Edit

Ensure that:

  • The Callback URL is the exact URL where you expect OAuth data.
  • The URL is publicly accessible via ngrok (Magento might fail if it detects localhost).
  • Both the Identity Link URL and Callback URL are using https.

You mentioned clearing the oauth_token table, but try it again with a full refresh:

DELETE FROM oauth_token WHERE consumer_id IN (SELECT consumer_id FROM oauth_consumer WHERE name='YourIntegrationName');

 

you may need to clear the Magento cache also after clearing the oauth_token table entries.

 

If the issue will be resolved, Click Kudos & Accept as a Solution.

Re: Magento2 not receiving oauth data for callback url during integration

thanks @Milople