2 * KQOAuth - An OAuth authentication library for Qt.
4 * Author: Johan Paul (johan.paul@d-pointer.com)
5 * http://www.d-pointer.com
7 * KQOAuth is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
12 * KQOAuth is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with KQOAuth. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef KQOAUTHMANAGER_P_H
21 #define KQOAUTHMANAGER_P_H
23 #include "kqoauthauthreplyserver.h"
24 #include "kqoauthrequest.h"
26 class KQOAUTH_EXPORT KQOAuthManagerPrivate {
29 KQOAuthManagerPrivate(KQOAuthManager *parent);
30 ~KQOAuthManagerPrivate();
32 QList< QPair<QString, QString> > createQueryParams(const KQOAuthParameters &requestParams);
33 QMultiMap<QString, QString> createTokensFromResponse(QByteArray reply);
34 bool setSuccessfulRequestToken(const QMultiMap<QString, QString> &request);
35 bool setSuccessfulAuthorized(const QMultiMap<QString, QString> &request);
37 bool setupCallbackServer();
39 KQOAuthManager::KQOAuthError error;
40 KQOAuthRequest *r; // This request is used to cache the user sent request.
41 KQOAuthRequest *opaqueRequest; // This request is used to creating opaque convenience requests for the user.
42 KQOAuthManager * const q_ptr;
45 * The items below are needed in order to store the state of the manager and
46 * by that be able to do convenience operations for the user.
48 KQOAuthRequest::RequestType currentRequestType;
50 // Variables we store here for opaque request handling.
51 // NOTE: The variables are labeled the same for both access token request
52 // and protected resource access.
54 QString requestTokenSecret;
56 QString consumerKeySecret;
57 QString requestVerifier;
59 KQOAuthAuthReplyServer *callbackServer;
61 bool hasTemporaryToken;
65 QNetworkAccessManager *networkManager;
68 Q_DECLARE_PUBLIC(KQOAuthManager);
71 #endif // KQOAUTHMANAGER_P_H