Above the issue
I am trying to fetch access token to read data from my own google account using vb.net window forms application . Am I missing anything?
Why should it open web browser for authorization? I just need to access my own data only.
Window form Code
Private Async Sub GetToken()
Dim scopes As New List(Of String)
scopes.Add(KeepService.Scope.Keep)
Dim stream = New FileStream("file path.json", FileMode.Open)
Dim _userCredentials As UserCredential =
Await Google.Apis.Auth.OAuth2.GoogleWebAuthorizationBroker.AuthorizeAsync(
GoogleClientSecrets.Load(stream).Secrets, scopes, "user", System.Threading.CancellationToken.None)
End Sub
Error Details
Authorization Error Error 400: invalid_scope Some requested scopes cannot be shown: [https://www.googleapis.com/auth/keep]