• Resolved albigiusti

    (@albigiusti)


    Hi,
    I’m trying to receive wp emails from localhost but I get this error when trying to confirm authorization:

    400.
    Error: redirect_uri_mismatch

    The redirect URI in the request, http://localhost/lacgiu/wp-admin/options-general.php?page=wp-mail-smtp&tab=auth, does not match the ones authorized for the OAuth client. To update the authorized redirect URIs, visit: […]

    response_type=code
    access_type=offline
    client_id=32276782684-nccj3f5k8i7oikg4ekbloack16lg30q5.apps.googleusercontent.com
    redirect_uri=http://localhost/lacgiu/wp-admin/options-general.php?page=wp-mail-smtp&tab=auth
    state=
    scope=https://mail.google.com/
    approval_prompt=force
    include_granted_scopes=true

    I followed this guide to setup G Suite: https://wpforms.com/how-to-securely-send-wordpress-emails-using-gmail-smtp/
    Since I’m working on a local server, I used (http://)lvh.me as website URL, could that be the problem?

    Thanks in advance

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi albigiusti,

    You’re on the right track here, and your local site is definitely the issue. That’s not to say that you can’t set this up on a local site — you absolutely can (I have this set up on my own local site).

    However, you’ll need to give your local site a more traditional URL in order for Google to accept it (rather than http://localhost/lacgiu). The exact way to go about this will vary depending on what tool you use to set up your local site, but a quick Google search should hopefully help you find instructions.

    Once you have a URL set up for your local site, you’ll be able fill out everything in your Google app setup with that URL just like you would for a live site (and if you later launch to an actual live URL, you’d need to adjust the URL in all Google settings again).

    I hope this helps!

    Hi albigiusti,

    We haven’t heard back from you in about a week, so I’m going to go ahead and close this thread for now. But if you still have questions, please feel welcome to continue the conversation!

    Thanks 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Error 400 redirect_uri_mismatch on local server’ is closed to new replies.