I'm trying to access a Gmail account with OAuth. Following the example of
https://www.limilabs.com/blog/oauth2-gmail-imap-installed-applications
- I use nuget to download the Google.Apis.Auth package
- Register the application
- I put the imports namespaces
Imports Google.Apis.Auth.OAuth2
Imports Google.Apis.Auth.OAuth2.Flows
Imports Google.Apis.Auth.OAuth2.Requests
Imports Google.Apis.Auth.OAuth2.Responses
Imports Limilabs.Client.Authentication.Google
Imports Limilabs.Client.IMAP
Below I put:
Dim clientID As String = "XXX.apps.googleusercontent.com"
Dim clientSecret As String = "IxBs0g5sdaSDUz4Ea7Ix-Ua"
Dim clientSecrets = New ClientSecrets With { _
.ClientId = clientID, _
.ClientSecret = clientSecret _
}
Dim credential = New GoogleAuthorizationCodeFlow( _
New GoogleAuthorizationCodeFlow.Initializer With { _
.ClientSecrets = clientSecrets, _
.Scopes = { _
GoogleScope.ImapAndSmtp.Name, _
GoogleScope.UserInfoEmailScope.Name}_
})
But the word GoogleScope in the last 2 lines tells me that it is not declared, what am I missing?
Thanks.