Assistance Required for "redirect_uri_mismatch" Error in OAuth2 Setup

51 views
Skip to first unread message

Himansu Patel Tecstub

unread,
Nov 26, 2024, 2:54:44 AM11/26/24
to Google Ads API and AdWords API Forum

I followed the instructions on Google Ads API OAuth setup to create a cloud project and set up an OAuth2 web application for a client ID and secret.

However, when I run GenerateUserCredentials.php via the PHP CLI, it generates a URL. Upon opening the URL in my browser, I encounter the following error:

Error 400: redirect_uri_mismatch

I have tried this process multiple times with different accounts and from a localhost server, but I receive the same error every time.

Could you please advise on how to resolve this issue?

Thank you for your assistance.


"The information contained in this e-mail and any attachments to this message are intended for the exclusive use of the intended recipient and may contain proprietary, confidential, or legally privileged information. If you are not the intended recipient, please do not disseminate, distribute, or copy this e-mail or any parts of it or act upon/ rely on the contents of this e-mail in any manner."

Google Ads API Forum Advisor

unread,
Nov 26, 2024, 5:47:39 AM11/26/24
to himans...@tecstub.com, adwor...@googlegroups.com
Hi,

Thank you for reaching out to the Google Ads API support team.

Based on the information provided, I understand that you are getting ' Redirect_URI_Mismatch ' when configuring OAuth setup. This error normally happens if you missed something in the configuration of OAuth2 credentials or refresh token. Could you please confirm if you followed this guide to generate your credentials and which app type have you configured? And also  could you please confirm if you have entered the correct line of “https://developers.google.com/oauthplayground” under Authorized redirect URIs?

Refresh tokens can also be manually revoked. I would suggest that you generate a new refresh token and use this to get an access token by following the instructions provided here. Let me know if this works.
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02vGm7M:ref" (ADR-00276811)

Thanks,
 
Google Logo Google Ads API Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5


 


Himansu Patel Tecstub

unread,
Nov 27, 2024, 7:30:33 AM11/27/24
to Google Ads API and AdWords API Forum
Yes it's set according to guide please check attachment.

When open URL it's shown same error.
Screenshot from 2024-11-27 17-56-31.png
Screenshot from 2024-11-27 17-58-37.png

Google Ads API Forum Advisor

unread,
Nov 27, 2024, 11:28:23 AM11/27/24
to himans...@tecstub.com, adwor...@googlegroups.com

Hi,

As per provided information, I understand that you are getting the 'Redirect_URI_Mismatch' error when configuring OAuth setup even after following the given documentation. Please note that we can only assist with technical queries/concerns related to the Google Ads API. If you have any more queries related to the OAuth setup, I would recommend you to reach out to the GCP Product support team for further assistance as they are better equipped to address your concerns. Additionally, I would suggest you refer to  Google Cloud Platform help center article for more information.

Reply all
Reply to author
Forward
0 new messages