void SoundCloudService::Connect() { OAuthenticator* oauth = new OAuthenticator( kApiClientId, kApiClientSecret, OAuthenticator::RedirectStyle::REMOTE_WITH_STATE, this); oauth->StartAuthorisation(kOAuthEndpoint, kOAuthTokenEndpoint, kOAuthScope); NewClosure(oauth, SIGNAL(Finished()), this, SLOT(ConnectFinished(OAuthenticator*)), oauth); }
void SkydriveService::Connect() { OAuthenticator* oauth = new OAuthenticator( kClientId, kClientSecret, OAuthenticator::RedirectStyle::REMOTE, this); if (!refresh_token().isEmpty()) { oauth->RefreshAuthorisation(kOAuthTokenEndpoint, refresh_token()); } else { oauth->StartAuthorisation(kOAuthEndpoint, kOAuthTokenEndpoint, kOAuthScope); } NewClosure(oauth, SIGNAL(Finished()), this, SLOT(ConnectFinished(OAuthenticator*)), oauth); }
void SoundCloudService::Connect() { OAuthenticator* oauth = new OAuthenticator( kApiClientId, kApiClientSecret, OAuthenticator::RedirectStyle::REMOTE_WITH_STATE, this); QSettings s; s.beginGroup(kSettingsGroup); QString refresh_token = s.value("refresh_token").toString(); if (!refresh_token.isEmpty()) { oauth->RefreshAuthorisation(kOAuthTokenEndpoint, refresh_token); } else { oauth->StartAuthorisation(kOAuthEndpoint, kOAuthTokenEndpoint, kOAuthScope); } NewClosure(oauth, SIGNAL(Finished()), this, SLOT(ConnectFinished(OAuthenticator*)), oauth); }