This topic describes how you can obtain a private key and an access token to allow your users to work with your Google Drive assets.
To get a key for a user account
client_secret.json
.The Google Drive web service uses Google Access Tokens to work under user accounts.
Prior to the token generation, you need to specify paths to your client key and an output token file in gdtokengen.exe.config
.
<configuration> <appSettings> <add key="OAuthClientSecretPath" value="client_secret.json" /> <add key="OAuthClientCredentialPath" value="" /> </appSettings> ... </configuration>
In this example, the OAuthClientSecretPath parameter defines the location of the OAuth Client (the client_secret.json
file) in the same folder where you unzipped this console application to. If OAuthClientCredentialPath is an empty string, then a token file will be created in the folder specified in OAuthClientSecretPath.
To generate a token:
gdtokengen.exe
.
Google.Apis.Auth.OAuth2.Responses.TokenResponse-CustomersCanvas
token file has appeared in your OAuthClientCredentialPath
folder.