Google Contacts

With google contacts, you can sync your google contacts through OAuth2 with the Vodia PBX, using the Google People API. With OAuth2 your password information need not be stored on the system. Instead, a separate window pops up to verify your credentials and provide an auth code, which you use to sync the contacts automatically every 10 minutes. You can stop it by pressing the button to log out form the account and stop syncing. It will also stop if the PBX is stopped. On restart of the PBX you will have to verify your credentials again for the periodic syncing of the contacts.

Obtain Client ID and Client Secret

Before the users of a domain can use the google contacts, you have to obtain the client id and client secret for that domain and enter it in the PBX domain settings.

  • Sign in to the google account which you want to use for getting the id and secret.
  • Then go to: https://console.developers.google.com
  • Click on "ENABLE APIS AND SERVICES" as shown:
  • Shows enabling apis
  • Search for "people api" as shown, and click on Google People API:
  • Search for people api
  • Enable this API as shown:
  • Enable people api
  • Now that the Google People API has been enabled, you can create your credentials and obtain the client id and secret
  • For that, go back to: https://console.developers.google.com
  • Under "Credentials", go to the OAuth consent screen as shown:
  • OAuth consent screen
  • This is the consent information that the user will be presented for giving access to his contacts
  • The details here are only for testing, you should enter your own company and domain information here, then save.
  • Finally, go to the Credentials tab under "Credentials" and click on "Create credentials" as shown:
  • Create crendentials
  • Choose OAuth client ID. A new screen will appear as shown:
  • Credential details like callback uri
  • Choose Web application, and give it a name by which you can identify these credentials
  • Enter the "Authorized JavaScript origins" as the domain of the PBX (the domain with which you can reach the PBX domain in the browser)
  • Enter the "Authorized redirent URIs" as the domain of the PBX as above with "/google_token.htm" appended to that URI.
    • This is very important that the URI is reachable to your PBX domain as that is where it will be redirected after user consent
    • For example: If the domain is https://example.com, then you will have to enter here "https://example.com/google_token.htm"
  • Press "Create". New credentials will be created in the project you selected. If its the first time a new project will be created for you and the credentials will be created there
  • Now you can click on the name of the credentials you gave it above and you can see the client ID and client secret created
  • Copy the client ID and client secret in the PBX domain settings in the "Google contacts client ID" and "Google contacts client secret" fields respectively, as shown:
  • Vodia domain settings where client id and client secret should be set
  • And "Save" it
  • Now the users (extensions) in this domain can get access to their Google Contacts by providing consent using their own google account and password through OAuth authentications, explained below.

How to Sync Contacts

Before google contacts can be synced, the user has to give consent by using his own google account and password.

  • Go to your user portal settings as shown:
  •  
  • Google contacts in user portal for consent
  • Press "Get Auth Code".
  • A new window will pop up asking you to sign in with your google account if you are not signed in already in another tab.
  • Sign in with your google account and password.
  • A new screen will appear asking you for consent as shown:
  • Google consent screen
  • Press "Allow" to give your domain consent to sync your contacts.
    • The information here for testing purposes, but here you will see what was set in the consent screen above during credentials creation.
  • The Google Contacts will be synced which you can see in your user portal contacts.
  • It may take some time to sync, so give it some time. This process needs to be done only once. After that, the system will re-sync the contacts every 10 minutes automatically.
  • These contacts will also appear on your phone through LDAP.
  • To logout from the account, press the button.