> For the complete documentation index, see [llms.txt](https://docs.meta-inf.hu/email-this-issue/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.meta-inf.hu/email-this-issue/email-this-issue-for-jira-server-data-center/documentation/administration/mail-server-connections/gmail-with-oauth2.md).

# Gmail with OAuth2

To connect to a Gmail address, you must first set up OAuth 2.0 credentials.

1. Log in to your Google account
2. Visit the following link in your Google account:
   * <https://console.cloud.google.com/apis/dashboard>
   * If this is the first time you are here, do the following:

     * Accept the Terms of Service:

     <div align="left"><figure><img src="https://4173056255-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FY44m7ZY1jU4Arh2tzwNn%2Fuploads%2FfGkGJnkVd6q8V1gkhwJk%2FK%C3%A9perny%C5%91k%C3%A9p%202024-01-03%20114009.png?alt=media&amp;token=03c62841-9868-425a-884d-9028c898261e" alt="" width="279"><figcaption></figcaption></figure></div>

     * Agree to the Terms of Service, then click **Agree and continue**.
   * If you have already agreed to the Terms of Service, you can select one of your existing projects or create a new one:\ <img src="https://4173056255-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FY44m7ZY1jU4Arh2tzwNn%2Fuploads%2FXJ4315UkCl3EOfVHXXKz%2Fimage.png?alt=media&amp;token=60813b82-7583-4f00-8387-a7b190566345" alt="" data-size="original"><br>
3. Navigate to the OAuth consent screen to configure it, if you do not have one already:\
   ![](https://4173056255-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FY44m7ZY1jU4Arh2tzwNn%2Fuploads%2FqTftIfGAiBDMYCDutEk6%2Fimage.png?alt=media\&token=331653d8-1a6f-49c2-ba35-65d3644857f9)
4. Click Get Started
   1. In App Information, enter the application name (for example, “Email This Issue”) and select a support email

      \
      ![](https://4173056255-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FY44m7ZY1jU4Arh2tzwNn%2Fuploads%2Fzlt3h5tQmogfWNULCocM%2Fimage.png?alt=media\&token=5c262a67-c21d-4ea3-b9ae-d306bf6305e3)
   2. In Audience, select whether the app is Internal or External, according to your requirements:\
      ![](https://4173056255-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FY44m7ZY1jU4Arh2tzwNn%2Fuploads%2F7FSHZvXwRpy46pmELP1u%2Fimage.png?alt=media\&token=2b4911c2-32a6-4aaa-94a5-29e3b42aa9e5)
   3. Enter contact information
   4. Agree to the User Data Policy\
      ![](https://4173056255-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FY44m7ZY1jU4Arh2tzwNn%2Fuploads%2FM7EWHVoYiK1IqCJOpSq1%2Fimage.png?alt=media\&token=5fe292c9-e8a7-4e79-bfd9-9770b7cb48f0)
   5. Click create
5. Go to Branding and add meta-inf.hu as an authorized domain:\
   ![](https://4173056255-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FY44m7ZY1jU4Arh2tzwNn%2Fuploads%2F2KjybSs5GG2HmY5AVCnE%2Fimage.png?alt=media\&token=53bceab1-75d2-43e6-b0c4-413387865e0f)

{% hint style="warning" %}

#### Additional Step for External applications:

Go to the **Audience** menu and either add the authorizing user as a **Test user** or **publish** the application; otherwise, you will not be able to authenticate the connection.
{% endhint %}

6. Go to the **Clients** menu and click **Create Client**. If you already had a Consent screen, go to Credentials, click Create credentials, and choose OAuth client ID.\ <br>

   <figure><img src="https://4173056255-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FY44m7ZY1jU4Arh2tzwNn%2Fuploads%2FSNNO9sTKJ5VVGmRdIjLg%2Fimage.png?alt=media&amp;token=fa11ad01-8e22-4524-83c9-28716ea6a774" alt=""><figcaption></figcaption></figure>
7. Select Web application as the application type, and give it a name\
   ![](https://4173056255-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FY44m7ZY1jU4Arh2tzwNn%2Fuploads%2FplcGTDxiy6E3n1mNNz2l%2Fimage.png?alt=media\&token=1021620b-39aa-4509-9153-675e0e71ccf7)
8. Open Email This Issue and on the Admin tab go to **OAuth2 credentials**. Click to **Create** new credentials, select **Google** as the service provider, then copy and paste the **Redirect URI** from the bottom to the **Authorized redirect URI** in Google:<br>

   <figure><img src="https://4173056255-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FY44m7ZY1jU4Arh2tzwNn%2Fuploads%2FLw5IiRBuoDGamVv1mEwE%2Fimage.png?alt=media&amp;token=d75e3be5-10a4-413d-bf67-1a28275af3ee" alt=""><figcaption></figcaption></figure>
9. Click **Create** in Google to create the client.
10. Copy the Client ID and Client secret to the appropriate fields in Email This Issue:\ <br>

    <figure><img src="https://4173056255-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FY44m7ZY1jU4Arh2tzwNn%2Fuploads%2FryZibaswTxmo1JlNoFJz%2Fimage.png?alt=media&amp;token=d3bbfbde-5ed3-4162-aecd-07a47816bacb" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Note: The client secret is only blurred for data protection purposes in this example.
{% endhint %}

11. In Email This Issue, add the following endpoints:

* Auth Endpoint URL: <https://accounts.google.com/o/oauth2/auth>
* Token Endpoint URL: <https://oauth2.googleapis.com/token>

<figure><img src="https://4173056255-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FY44m7ZY1jU4Arh2tzwNn%2Fuploads%2FuRs0mGE5dV1u7taG5FS9%2Fcreds_4.png?alt=media&amp;token=1a004718-4285-45aa-9ba2-467fa12fe6d5" alt=""><figcaption><p>Edit OAuth2 Credentials</p></figcaption></figure>

13. Click on **Save**, and you are ready to use the created credentials in your incoming or outgoing connection.
