Module Google: Difference between revisions

Jump to navigation Jump to search
m
no edit summary
Tag: 2017 source edit
mNo edit summary
Tag: 2017 source edit
Line 107: Line 107:




3) You must create a service account user/email from page {{ModuleGoogleUrlToCreateApiAccount}}, menu "Credentials" . Click on "Create a client ID" and choose "Service Account" then choose "type of file P12" then "Create". You must check that the option "Enable G-Suite Domain wide validation" in section "Show domain wide validation" in the properties of the service account is set to On.
3) You must create a service account user/email from page {{ModuleGoogleUrlToCreateApiAccount}}, menu "Credentials" . Click on "Create a client ID" and choose "Service Account" then choose "type of file JSON" then "Create". You must check that the option "Enable G-Suite Domain wide validation" in section "Show domain wide validation" in the properties of the service account is set to On.
You will get:
You will get:


*A new service account with a Service account client ID and a Service account EMail. You need here to enter the Service account EMail.
*A new service account with a Service account client ID and a Service account EMail. You need here to enter the Service account EMail.
*A .p12 file was also downloaded.
*A .json file was also downloaded.


If you choose to synchronize to only 1 unique Google agenda target or to one different agenda for each user, you have only to create 1 service account. However, you may need to give permissions to all google account if you set 1 different agenda for each user (see step 5).
If you choose to synchronize to only 1 unique Google agenda target or to one different agenda for each user, you have only to create 1 service account. However, you may need to give permissions to all google account if you set 1 different agenda for each user (see step 5).
Line 123: Line 123:
5) You must also share the agenda (all permissions) with the service account user/email (created at step 2): For this, go into Google calendar, choose "'''Settings and Sharing'''" from the combo list on the right of your Agenda on the area "'''My Calendars'''" (It must be same Agenda than the one chosen on parameter "ID Agenda" at step 1). Click on link "Share with Specific people". Then add the service account user into the email field, choose permission "'''Make changes to events'''" and validate.  
5) You must also share the agenda (all permissions) with the service account user/email (created at step 2): For this, go into Google calendar, choose "'''Settings and Sharing'''" from the combo list on the right of your Agenda on the area "'''My Calendars'''" (It must be same Agenda than the one chosen on parameter "ID Agenda" at step 1). Click on link "Share with Specific people". Then add the service account user into the email field, choose permission "'''Make changes to events'''" and validate.  


With Google G Suite (not required for standard gmail account), permissions may be forced to "Ready only" instead of "Edit". To solve this, go onto  
With Google G Suite (not required for standard gmail account), permissions may be forced to "Ready only" instead of "Edit". To solve this, go onto {{GoogleURLToSetupCalendarAppSharing}} and check that sharing option of Agenda application ("External sharing options for primary calendars") to a value that allows sharing with external service account (Must be at least on value "Share all information, and outsiders can change calendars"). [[File:Warning.png]] A 24h delay may be required to be able to return and finish step 5.
{{GoogleURLToSetupCalendarAppSharing}}
 
and check that sharing option of Agenda application ("External sharing options for primary calendars") to value allows sharing with external service account (Must be at least on value "Share all information, and outsiders can change calendars"). [[File:Warning.png]] A 24h delay may be required to be able to return and finish step 5.
6) If you plan to add several users to an events (attendees), you must also go on page https://admin.google.com/ac/owl/domainwidedelegation to give permission on scope https://www.googleapis.com/auth/calendar and https://www.googleapis.com/auth/calendar.events for the Client ID relates to the service account.


Once all steps are done, you can use the button to make a synchronization test. Click on it to make a test.
Once all steps are done, you can use the button to make a synchronization test. Click on it to make a test.
Line 136: Line 136:
*If you receive error "ERROR Error calling POST https://www.googleapis.com/calendar/v3/calendars/yourcalendarid/events: (403) Forbidden": Check the step 5 was done and that permission granted was read and write and not read only.
*If you receive error "ERROR Error calling POST https://www.googleapis.com/calendar/v3/calendars/yourcalendarid/events: (403) Forbidden": Check the step 5 was done and that permission granted was read and write and not read only.


*If you receive error "ERROR Error calling POST https://www.googleapis.com/calendar/v3/calendars/yourcalendarid/events: (403) Service accounts cannot invite attendees without Domain-Wide Delegation of Authority": Check the step 3 is done (test on G-Suite domain wide validation) and the step 5 is also done to allow external acounts (so your service account) to edit calendar.
*If you receive error "ERROR Error calling POST https://www.googleapis.com/calendar/v3/calendars/yourcalendarid/events: (403) Service accounts cannot invite attendees without Domain-Wide Delegation of Authority": Check the step 3 is done (check the "G-Suite domain wide validation") and the step 5 is also done to allow external accounts (so your service account) to edit calendar and the step 6 is also done.


*[[File:Warning.png]] Note: A possible error is that Google denies access, even if your setup is correct, just because the server that host Dolibarr is located into another country or region than the one using google apps usually.
*[[File:Warning.png]] Note: A possible error is that Google denies access, even if your setup is correct, just because the server that host Dolibarr is located into another country or region than the one using google apps usually.

Navigation menu