示例#1
0
        public async Task SignIn(AuthenticationResult authenticationResult, string codeVerifier)
        {
            // Use the authentication result to get an access token
            this.CurrentToken = await GoogleDriveClient.GetAccessToken(authenticationResult, codeVerifier).ConfigureAwait(false);

            // Create the OneDrive client, set the token refresh callback to save new tokens.
            await this.InitializeClient().ConfigureAwait(false);
        }
示例#2
0
        public async Task InitializeClient()
        {
            this.googleDriveClient = new GoogleDriveClient(this.CurrentToken);
            this.googleDriveClient.TokenRefreshed += (s, e) =>
            {
                //this.PersistedConfiguration.CurrentToken = accessToken;
                this.CurrentToken = e.NewToken;
                this.SaveConfiguration();
            };

            // Get the user profile.
            this.UserProfile = await this.googleDriveClient.GetUserInformation().ConfigureAwait(false);
        }
 internal GoogleFileDownloadStream(GoogleDriveClient client, string itemId)
 {
     this.client = client;
     this.itemId = itemId;
 }