> For the complete documentation index, see [llms.txt](https://help.solar-archive.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.solar-archive.com/docs/msp-onboarding-guide/google-workspace-onboarding/google-workspace-oauth/linking-the-oauth-client-id-to-your-workspace.md).

# Linking the OAuth Client ID to your Workspace

* You have a Google Cloud Project. Within this project we define an API Services. This consists of an OAuth Consent screen, and our Web Application based OAuth Client. This OAuth Client relates to connections from the YOUR ARCHIVE redirect URIs . Now this OAuth Client ID should be linked to your Workspace.
* Please access your Google Workspace administration area ([admin.google.com](http://admin.google.com)), using an administration user login. It should look something like the following:

  <figure><img src="/files/MbhzFJnuRLPHVyXMLO4r" alt=""><figcaption></figcaption></figure>
* Navigate to the Security > Access and data control > API controls panel. Click the “Manage Third-Party App Access”:

  <figure><img src="/files/u3N6z1cb0MU5k3UL1aQy" alt=""><figcaption></figcaption></figure>
* Here you can view any external API’s that you can set permissions to access your Workspace services. Initially this list will be blank, and we will need to add an entry for our API Project.

  <figure><img src="/files/CtCmqs34R04wKYUyXrou" alt=""><figcaption></figcaption></figure>
* "Configure new app”, then you selected “OAuth App Name or Client ID”.

  <figure><img src="/files/hdbrATQyvVTNAVs2lzVc" alt=""><figcaption></figcaption></figure>
* You will need to obtain the Client-ID value from your Google Cloud Project under APIs and services. If your project doesn’t show up it may not have updated yet.

  <figure><img src="/files/EK9L6Lw51GiuWf7n8HXz" alt=""><figcaption></figcaption></figure>
* Click the Copy icon and paste into your Workspace, and click Search. If it does not return your API, please wait a few minutes – and try again until it does show\... Once your API app shows, then click it.

  <figure><img src="/files/e5BsU9Ivo0ughUrUqiiy" alt=""><figcaption></figcaption></figure>
* Next you must select the scope – the set of users who will be allowed to access this App \[the YOUR ARCHIVE] using OAuth. To allow all users of your Workspace to have access using this OAuth Api, then select the All in \<your organisation> option. But you can set a more restrictive set if you require.

  <figure><img src="/files/rHEy4tCX7sonpaqQApre" alt=""><figcaption></figcaption></figure>
* Press ‘Select’ and next it will ask if you trust this App. YOUR ARCHIVE only needs to obtain the logging-in user’s name and email address(es). In a update to Google Workspace you can now select this new “Specific Google data” option, which should be sufficient:

  <figure><img src="/files/VzI0MISEy94jlxWk8Rel" alt=""><figcaption></figcaption></figure>
* After the Review screen, save (‘Finish’) the new app. That completes the OAuth for Login setup!

## YOUR ARCHIVE “Login with Google”

* Finally! We are ready to try the Login. If you now access the Archive Login page, you should see a new Login with Google button. Press this new button to initiate the login process.

  <figure><img src="/files/gzxMlFxyWapTdHuCJQOS" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/EURilZ77Ie17ttkwW0GL" alt=""><figcaption></figcaption></figure>

* It should then link to the Google Authentication service. This first time it should show the Consent Screen details/logo that you entered into the API.

  <figure><img src="/files/L8qc1wEVVCyCiy5f7mV5" alt=""><figcaption></figcaption></figure>

## Access Blocked – Redirect URI

* If you see an Access blocked error, then it could relate to the “Redirect URI”.

  <figure><img src="/files/wXexVXnQ61PnGpxjYO81" alt=""><figcaption></figcaption></figure>
*

```
<figure><img src="/files/djgyVcryvNSt2Y5tjLyJ" alt=""><figcaption></figcaption></figure>
```

* If you click the “error details" link, you will see the Redirect URI that it is complaining about. This URI should match the Email Archive service you are trying to access. What you need to do is to copy-paste that redirect-uri into the Google API OAuth Client ID panel. These will be provided by YOUR PROVIDER.

<figure><img src="/files/pAyocrGOSKD3IhQXjjGx" alt=""><figcaption></figcaption></figure>

### OAuth login failed

Some users encounter a bug in which the above message comes up, which if clicked upon gives a large text starting with “user does not have license java.lang.Exception: user does not have license at”.

The cause is often a setting of the following name: “Disable login of unlicensed Office365 users”. It is likely that you will have to contact your provider to change this in the global settings.
