You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c88c728
Browse filesBrowse the repository at this point in the historyBrowse files
fix(search): run live Calendar service search on the crawl scope
PR #8208 widened Google Calendar's domain-wide delegation scopes to include
calendar.readonly for every service-account token. Google refuses the whole
token exchange when any requested scope is not authorized for the client, so
indexed admin-mode Calendar syncs configured for calendar.events.readonly
failed every run and were eventually disabled.
Live service search only needed the wider scope to read an all-day event's
calendar time zone. events.list returns the calendar's timeZone under
calendar.events.readonly, so live search now reads it there and runs on the
same single scope as indexing; save-time validation therefore covers live
sources too.
The admin calendar picker impersonates with calendar.calendarlist.readonly and
resolves names from the admin's calendar list. When Google refuses a delegated
token, the picker, save-time validation, and live search share one message
that names the scopes an administrator must authorize, and a delegated 401/403
in service mode no longer tells the member to reconnect their own account.
`calendar.readonly` is needed for calendar metadata and the CalendarList picker; event-read scope alone is insufficient. See [CalendarList authorization](https://developers.google.com/workspace/calendar/api/v3/reference/calendarList/list).
25
+
Search reads events with `calendar.events.readonly`. The calendar picker also needs `calendar.calendarlist.readonly` to list the delegated administrator's calendars. See [CalendarList authorization](https://developers.google.com/workspace/calendar/api/v3/reference/calendarList/list).
26
26
27
27
3. In **Settings → Sources → Google Calendar**, choose **Service account**, then **Add connection**. Add or select the Google credential and set **Delegated administrator** to an active Workspace administrator with Directory user-read access.
28
28
4. Select calendars, users, a date range, and optional event-text and attendee settings. Save and select this connection as the service source.
@@ -44,7 +44,7 @@ Sim does not copy the organizer's richer event details into an attendee's view o
44
44
45
45
| Problem | Next step |
46
46
| --- | --- |
47
-
| Calendar picker or metadata read fails | Include `calendar.readonly` in delegation, along with the other scopes above. |
47
+
| Calendar picker fails | Include `calendar.calendarlist.readonly` in delegation, along with the other scopes above. |
48
48
| A member gets no matches | Check their personal connection, primary Workspace identity, Users selection, calendars, and source date window. |
49
49
| Shared calendar is missing | Confirm both the member and delegated source identity can access that calendar ID. |
50
50
| Event is outside the configured range | Adjust the service source's range or narrow the user's query to its allowed window. |
"Google rejected service-account authorization (unauthorized_client). In Google Admin, authorize the JSON key's numeric client ID with the exact domain-wide delegation scopes in this connector's service-account setup section. Verify the delegated user's Workspace email and allow time for recent delegation changes to propagate."
350
-
break
351
-
case'invalid_grant':
352
-
message=
353
-
"Google rejected the service-account grant (invalid_grant). Check that the JSON key is valid and the delegated user's primary Workspace email is correct."
354
-
break
355
-
case'invalid_scope':
356
-
message=
357
-
"Google rejected the service-account scopes (invalid_scope). In Google Admin, authorize the exact domain-wide delegation scopes in this connector's service-account setup section."
358
-
break
359
-
case'access_denied':
360
-
message=
361
-
'Google denied service-account access (access_denied). Ask your Workspace administrator to check API access policies and domain-wide delegation.'
: "the exact domain-wide delegation scopes in this connector's service-account setup section"
28
+
switch(error.errorCode){
29
+
case'unauthorized_client':
30
+
return`Google rejected service-account authorization (unauthorized_client). In Google Admin, authorize the JSON key's numeric client ID with ${delegationScopes}. Verify the delegated user's Workspace email and allow time for recent delegation changes to propagate.`
31
+
case'invalid_grant':
32
+
return"Google rejected the service-account grant (invalid_grant). Check that the JSON key is valid and the delegated user's primary Workspace email is correct."
33
+
case'invalid_scope':
34
+
return`Google rejected the service-account scopes (invalid_scope). In Google Admin, authorize ${delegationScopes}.`
35
+
case'access_denied':
36
+
return'Google denied service-account access (access_denied). Ask your Workspace administrator to check API access policies and domain-wide delegation.'
0 commit comments