MCPcopy Create free account
hub / github.com/bumptop/BumpTop / getRequestToken

Method getRequestToken

trunk/win/Source/OAuthClient.cpp:83–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81}
82
83bool OAuthClient::getRequestToken( QString requestTokenRequestUri, QString cKey, QString cSecret )
84{
85 _cKey = cKey;
86 _cSecret = cSecret;
87 _requestTokenRequestUri = requestTokenRequestUri;
88
89 // skip this whole process if we already have an access token
90 if (!GLOBAL(settings).tw_oauth_key.isEmpty() &&
91 !GLOBAL(settings).tw_oauth_secret.isEmpty())
92 return true;
93
94 // otherwise, get the request token to obtain the access token
95 QHash<QString, QString> params;
96 prepareParameters(_requestTokenRequestUri, "POST", params);
97 QString result = postHttpRequest(_requestTokenRequestUri, params);
98 if (!result.isEmpty())
99 {
100 // example: oauth_token=hh5s93j4hdidpola&oauth_token_secret=hdhd0244k9j7ao03
101 QHash<QString, QString> newParams;
102 if (extractParams(result, newParams))
103 {
104 if (extractTokens(newParams))
105 {
106 return true;
107 }
108 }
109 }
110 return false;
111}
112
113bool OAuthClient::getAccessToken( QString accessTokenRequestUri, QString oauthVerifierToken )
114{

Callers 1

initializeMethod · 0.80

Calls 1

isEmptyMethod · 0.45

Tested by

no test coverage detected