Getting 400 Error: redirect_uri_mismatch when trying to grant permission to Gmail SMTP plugin

enter image description here

I am trying to add Google SMTP plugin to my wordpress website.

I have installed plugin, then went to Google Developer Console created new project, added Gmail API, added Credentials.

Now this step came out different to how I remember it used to be. Instead of getting API key I got a JSON file that has all the info, still fields seem to match mostly.

I then went to settings form in Gmail SMTP Plugin and mapped settings in following way:

Client id field to client_id from Json
Client Secret field to private_key from Json
Client Email field to client_email from Json

(see below)

When I try to Grant Permission I get

  • That’s an error.
  • Error: redirect_uri_mismatch

    The redirect URI in the request, http://localhost/wordpress/wp-admin/options-general.php?page=gmail-smtp-settings&action=oauth_grant, does not match the ones authorized for the OAuth client. To update the authorized redirect URIs, visit: https://console.developers.google.com/apis/credentials/oauthclient/113520075367233598862?project=[my_project_id]

    So I clicked the link and added http://localhost/wordpress/wp-admin/options-general.php?page=gmail-smtp-settings&action=oauth_grant in google developer console, OAuth Conscent Screen tab Homepage URL (Optional) field and saved it but error remains my guess is ether I am not putting url into correct place or because I am running app from localhost.

    Where do I need to set up redirect url for this error to go away?

    Read more here:: Getting 400 Error: redirect_uri_mismatch when trying to grant permission to Gmail SMTP plugin

    Leave a Reply

    Your email address will not be published. Required fields are marked *