Meet us at SGIA Expo. Las Vegas, NV. Oct. 18—19.

The Google Drive Web Service

Now that you have private keys and tokens providing access to your Google Drive images, you can set up the Google Drive web service. This topic helps you configure this service.

Configuring the Google Drive web service

In the GoogleDriveWebService folder, open the Web.config file and find the default AppSettings section:

XML
<configuration>
    <appSettings>
        <add key="OAuthClientSecretPath" value="..\data\client_secret.json" />
        <add key="OAuthClientCredentialPath" value="" />
        <add key="ApiSecurityKey" value="UniqueSecurityKey" />
        <add key="HttpHeaderAllowOriginDomains" value="*" />
        <add key="ShowSharedWithMeFiles" value="false" />
    </appSettings>
    ...
</configuration>

Here, you can specify an optional parameter for both Google Drive account types:

  • HttpHeaderAllowOriginDomains restricts the use of your Google Drive images to pages hosted only on listed domains. The "*" default value allows access from any domain.

Also, Web.config contains type-specific parameters.

User Accounts

If you have a user account, then you need to specify the following mandatory parameters:

  • OAuthClientSecretPath defines the location of the client_secret.json file.
  • OAuthClientCredentialPath defines the location of your token file.
  • ApiSecurityKey is a secret key, which you send as X-GoogleDriveAPIKey in request headers to retrieve images.

Service Accounts

If you have a service account, specify the following mandatory parameters:

  • ServiceAccountEmail defines the email to generate a token.
  • ServiceAccountKeyPath defines the location of your private key in the PKCS #8 format.
  • ApiSecurityKey is a secret key, which you send as X-GoogleDriveAPIKey in request headers to generate tokens.

Running the Google Drive web service

To run this service, create a pool with the NetworkService identity and add a website to the Sites list in IIS Manager.

Note

IIS pool must have Read and Write permissions to the folder where you keep your token file.

See Also

Manual