Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

i'm a little bit despaired. I try to use the google DriveApi v2 to upload a file. However i'm not able to authenticate via oAuth2. I tried nearly every pice of code that i could found. If i execute the AuthorizeAsync Function i get an exception "No Application found". What is my mistake? If it is helpful i can send you the complete Clienet Secrets that you are able to try the code at your PC.
I'm glad about every help.

Thanks in advance.

VB
Imports System.Collections.Generic
Imports System.IO
Imports System.Threading
Imports Google.Apis.Services
Imports Google.Apis.Auth.OAuth2
Imports Google.Apis.Util.Store
Imports Google.Apis.Drive.v2

Module Program
    Sub Main()

        Dim Secrets = New ClientSecrets()
        Secrets.ClientId = "?????????????30qj3ac.apps.googleusercontent.com"
        Secrets.ClientSecret = "???????9ZFwnQBjBouF3Q_6Ja"

        Dim scope = New List(Of String)
        scope.Add(DriveService.Scope.Drive)

        Dim t As Task(Of UserCredential) = _
             GoogleWebAuthorizationBroker.AuthorizeAsync(Secrets, scope, _
             "USER", CancellationToken.None)
        Dim credential = t.Result()
    end Sub
end Module
Posted
Updated 4-Dec-14 5:29am
v2
Comments
E.F. Nijboer 4-Dec-14 11:31am    
I removed your email from the question to save you from a lot of spam. Also, the question should be answered on codeproject for future reference and people having the same question.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900