Answers.Body: <p>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.</p>
  <p>See <a href="https://docs.civicrm.org/sysadmin/en/latest/setup/civimail/#adding-an-incoming-email-account-for-processing-bounces-andor-email-to-activities" rel="nofollow noreferrer">https://docs.civicrm.org/sysadmin/en/latest/setup/civimail/#adding-an-incoming-email-account-for-processing-bounces-andor-email-to-activities</a> and click on the &quot;Adding an account via OAuth&quot; that looks like a section header but is really a hidden set of instructions.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-03-18T17:23:10.937Z
Answers.Text: 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
Answers.UserDisplayName: Vshura
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-03-18T17:35:34.150Z
Answers.Text: I didn't notice your screenshot the first time but the redirect uris should end in `/civicrm/oauth-client/return`
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-03-18T20:04:10.253Z
Answers.Text: 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.
Answers.UserDisplayName: Vshura
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-03-18T16:47:40.497Z
Answers.LastActivityDate: 2022-03-18T16:47:40.497Z
Answers.UserDisplayName: Demerit
Body: <p>I am getting an error while trying to set up OAuth. when I click on <strong>Add (Auth Code)</strong> button on <em>CiviCRM &gt;&gt; Admin &gt;&gt; OAuth2 Client Administration</em> I get the following error from Google:</p>
  <p><code>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&amp;q=civicrm%2Foauth-client%2Freturn</code></p>
  <p>On the CiviCRM side, it's all set up as follows:</p>
  <p><a href="https://i.sstatic.net/dqhmC.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/dqhmC.jpg" alt="CiviCRM OAuth Setup" /></a></p>
  <p>And on the Google Cloud Platform I've set up the following.</p>
  <p><a href="https://i.sstatic.net/LtmXN.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/LtmXN.jpg" alt="Google Cloud Platform Setup" /></a></p>
  <p>I have the OAuth extension installed and activated, and I'm running CiviCRM 7.47.2 on WordPress.
  Advice welcome!</p>
  
Tags: <civimail><oauth>
Title: Problem setting up OAuth for Google
ThreadText: # Problem setting up OAuth for Google
  
  (Asked by: username_0 on 2022-03-18)
  
  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](https://i.sstatic.net/dqhmC.jpg)](https://i.sstatic.net/dqhmC.jpg)
  
  And on the Google Cloud Platform I've set up the following.
  
  [![Google Cloud Platform Setup](https://i.sstatic.net/LtmXN.jpg)](https://i.sstatic.net/LtmXN.jpg)
  
  I have the OAuth extension installed and activated, and I'm running CiviCRM 7.47.2 on WordPress.
  Advice welcome!
  
  **Tags:** civimail, oauth
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2022-03-18. Score: 3 | Accepted answer
  
  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.
  
  > **Comments:**
  > **username_0**: 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 @username_1  
  > **username_1**: I didn't notice your screenshot the first time but the redirect uris should end in `/civicrm/oauth-client/return`  
  > **username_0**: 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.  
  
  ---
  
  