Discuss this help topic in SecureBlackbox Forum
OAuth: Use of OAuth client when refresh token is available
If you have a refresh token, there's no need to ask the user for authorization on each application start. Instead you can use the saved refresh token to obtain new access token. To do this you need to
C#:
// create and setup the http transport to be used to talk to
// the authorization server
TElHTTPSClient oauthTransport = new TElHTTPSClient();
// assign an event handler to validate SSL certificate(s)
oauthTransport.OnCertificateValidate += ...;
C#:
// create a OAuth 2.0 client
TElSimpleOAuth2Client oauth = new TElSimpleOAuth2Client();
// assign the created HTTPS transport
oauth.HTTPClient = https;
// set the local URL to be used during authorization;
// the specified port must be free and the application
// has to be allowed to open a listening socket on that port
oauth.RedirectURL = @"http://localhost:5050/";
// authorization server URLs
oauth.AuthURL = @"https://accounts.google.com/o/oauth2/auth";
oauth.TokenURL = @"https://accounts.google.com/o/oauth2/token";
// copy the client id and the client secret of your app
// registered in Google Developers Console
oauth.ClientID = @"your_client_id";
oauth.ClientSecret = @"your_client_secret";
// tell the authorization server what access is needed
oauth.Scope = @"https://www.googleapis.com/auth/userinfo.email
https://www.googleapis.com/auth/userinfo.profile";