I am getting an error while trying to set up OAuth. when I click on Add (Auth Code) button on CiviCRM >> Admin >> OAuth2 Client Administration I get the following error from Google:

Error 400: redirect_uri_mismatch You can't sign in to this app because it doesn't comply with Google's OAuth 2.0 policy. If you're the app developer, register the redirect URI in the Google Cloud Console. Learn more The content in this section has been provided by the app developer. This content has not been reviewed or verified by Google. If you’re the app developer, make sure that these request details comply with Google policies. redirect_uri: https://***.org/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Foauth-client%2Freturn

On the CiviCRM side, it's all set up as follows:

CiviCRM OAuth Setup

And on the Google Cloud Platform I've set up the following.

Google Cloud Platform Setup

I have the OAuth extension installed and activated, and I'm running CiviCRM 7.47.2 on WordPress. Advice welcome!

1 Answer 1


Yeah the Add Authcode button is a little confusing and meant for other types of Oauth implementations. The way to do it is not from that screen but from the Mail Accounts screen. Go add your google account there.

See https://docs.civicrm.org/sysadmin/en/latest/setup/civimail/#adding-an-incoming-email-account-for-processing-bounces-andor-email-to-activities and click on the "Adding an account via OAuth" that looks like a section header but is really a hidden set of instructions.

  • Unfortunately I get the exact same error when I try to do it that way - i.e. go to Administer > CiviMail > Mail Accounts and then try to add a Google Mail account @Demerit
    – Vshura
    Commented Mar 18, 2022 at 17:23
  • 1
    I didn't notice your screenshot the first time but the redirect uris should end in /civicrm/oauth-client/return
    – Demerit
    Commented Mar 18, 2022 at 17:35
  • 2
    Ah, yes, I didn't spot the information about what to put in return path. It was https://*****.org/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Foauth-client%2Freturn Thanks.
    – Vshura
    Commented Mar 18, 2022 at 20:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.