1// Copyright (C) 2017 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#include <QtNetwork/qtnetwork-config.h>
5
6#ifndef QT_NO_HTTP
7
8#include "qabstractoauthreplyhandler.h"
9#include "qabstractoauthreplyhandler_p.h"
10
11Q_LOGGING_CATEGORY(lcReplyHandler, "qt.networkauth.replyhandler")
12
13QT_BEGIN_NAMESPACE
14
15/*!
16 \class QAbstractOAuthReplyHandler
17 \inmodule QtNetworkAuth
18 \ingroup oauth
19 \brief Handles replies to OAuth authentication requests.
20 \since 5.8
21
22 The QAbstractOAuthReplyHandler class handles the answers
23 to all OAuth authentication requests.
24 This class is designed as a base whose subclasses implement
25 custom behavior in the callback() and networkReplyFinished()
26 methods.
27*/
28
29/*!
30 \fn QString QAbstractOAuthReplyHandler::callback() const
31
32 Returns an absolute URI that the server will redirect the
33 resource owner back to when the Resource Owner Authorization step
34 is completed. If the client is unable to receive callbacks or a
35 callback URI has been established via other means, the parameter
36 value \b must be set to "oob" (all lower-case), to indicate an
37 out-of-band configuration.
38
39 Derived classes should implement this function to provide the
40 expected callback type.
41*/
42
43/*!
44 \fn void QAbstractOAuthReplyHandler::networkReplyFinished(QNetworkReply *reply)
45
46 After the server determines whether the request is valid this
47 function will be called. Reimplement it to get the data received
48 from the server wrapped in \a reply. \a reply will be automatically
49 deleted using deleteLater(), it thus must not be stored beyond the
50 scope of this function.
51
52*/
53
54/*!
55 \fn void QAbstractOAuthReplyHandler::callbackReceived(const QVariantMap &values)
56
57 This signal is emitted when the reply from the server is
58 received, with \a values containing the token credentials
59 and any additional information the server may have returned.
60 When this signal is emitted, the authorization process
61 is complete.
62*/
63
64/*!
65 \fn void QAbstractOAuthReplyHandler::tokensReceived(const QVariantMap &tokens)
66
67 This signal is emitted when new \a tokens are received from the
68 server.
69*/
70
71/*!
72
73 \fn void QAbstractOAuthReplyHandler::tokenRequestErrorOccurred(QAbstractOAuth::Error error,
74 const QString& errorString)
75
76 This signal is emitted when a token request or refresh \a error has
77 occurred. The \a errorString may provide further details on the error.
78
79 \sa QAbstractOAuth::requestFailed()
80 \since 6.6
81*/
82
83/*!
84 \fn void QAbstractOAuthReplyHandler::replyDataReceived(const QByteArray &data)
85
86 This signal is emitted when an HTTP request finishes and the
87 data is available. \a data contains the response before parsing.
88*/
89
90/*!
91 \fn void QAbstractOAuthReplyHandler::callbackDataReceived(const QByteArray &data)
92
93 This signal is emitted when a callback request is received:
94 \a data contains the information before parsing.
95*/
96
97/*!
98 Constructs a reply handler as a child of \a parent.
99*/
100QAbstractOAuthReplyHandler::QAbstractOAuthReplyHandler(QObject *parent)
101 : QObject(parent)
102{}
103
104/*!
105 Destroys the reply handler.
106*/
107QAbstractOAuthReplyHandler::~QAbstractOAuthReplyHandler()
108{}
109
110/*! \internal */
111QAbstractOAuthReplyHandler::QAbstractOAuthReplyHandler(QObjectPrivate &d, QObject *parent)
112 : QObject(d, parent)
113{}
114
115QT_END_NAMESPACE
116
117#endif // QT_NO_HTTP
118

source code of qtnetworkauth/src/oauth/qabstractoauthreplyhandler.cpp