Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

certinia/ffhttp-googlemirror

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Apex Google Mirror API Framework

Deploy to Salesforce

Overview

An Apex framework has been created to provide functionality for Google Mirror API callouts.

This library extends the Core library to provide access to Google Mirror API calls found at https://developers.google.com/glass/v1/reference/.

Samples demonstrating the use of this library can be found here.

Key Features

  • Apex Google Mirror API

Configuration

This section explains how to create a connection between Salesforce and Google Mirror using the packages described above.

Make sure that the Core and Google Mirror packages have been deployed to your Saleforce organisation.

###Create an app in Google

  1. Log in to your Google account.
  2. Go to https://console.developers.google.com/project and select Create Project.
  3. Enter a project name and ok the dialog.
  4. Select the hyperlink for the project name that you just created.
  5. Expand the APIs & auth section.
  6. Select APIs.
  7. Enter Mirror in the Browse APIs section.
  8. Turn the Google Mirror API on.
  9. Select the Consent screen.
  10. Enter a Product Name, make sure the Email Address is set and save.
  11. Select Credentials.
  12. Select Create new Client ID.
  13. Select Web application.
  14. Set the Authorized Javascript Origins url to the URL of the Salesforce organisation e.g. https://eu3.salesforce.com.
  15. Set the Authorized Redirect URIs to the same as above with apex/connector appended: e.g. https://eu3.salesforce.com/apex/connector.
  16. Make sure you know the Client Id and Client Secret as they will be needed later.

###Create a Connector in Salesforce

This requires the OAuth Sample App to be deployed.

  1. Log in to your Salesforce organisation.
  2. Select the OAuth app.
  3. Select Connector Types then New.
  4. Enter a Connector Type Name e.g. Google Mirror.
  5. Set the Authorization Endpoint to https://accounts.google.com/o/oauth2/auth.
  6. Set the Token Endpoint to https://accounts.google.com/o/oauth2/token.
  7. Set the Client ID to the client ID obtained earlier.
  8. Set the Client Secret to the client secret obtained earlier.
  9. Set the Redirect URI to the same URL as you set in step 12 in the Create an app in Google section.
  10. Make sure that Scope Required is checked.
  11. For full access to Google Mirror add 'https://www.googleapis.com/auth/glass.location https://www.googleapis.com/auth/glass.timeline' as the scope.
  12. Set the Extra Url Parameters to access_type=offline&approval_prompt=force. Setting access_type to offline means that Google supplies a refresh token with the access token which is required if you do not wish to reautheniticate every time the access token expires.
  13. Save the Connector Type.
  14. Select New Connector.
  15. Set the Connector Name and save.
  16. Select the Connector and then Activate. You will be directed to another Salesforce page that activates your connector.
  17. Select Authorize. This will prompt you to log in to your Google account (if you are not already logged in) and then authenticate the scope provided earlier. Select Accept to authorize.
  18. Select Save. The connector is now ready for use.

Note that authorization can be revoked at any point by either deleting the connector in Salesforce or revoking access to the app in Google (Select your profile then Account > Security > Account Permissions > Apps and website (View All), choose the app created and then select Revoke Access).

###Google Mirror Scopes

To limit access to the Google Mirror functionality the following scopes can be used.

Reporting Issues & Enhancements

Please report any issues using the github issues feature. Suggestions / bug reports are welcome as are extensions containing additional functionality.

About

Apex framework to provide API calls for Google Mirror

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages