KUnifiedPush

nextcloudauthenticator.h
1 /*
2  SPDX-FileCopyrightText: 2022 Volker Krause <[email protected]>
3  SPDX-License-Identifier: LGPL-2.0-or-later
4 */
5 
6 #ifndef NEXTCLOUDAUTHENTICATOR_H
7 #define NEXTCLOUDAUTHENTICATOR_H
8 
9 #include <QObject>
10 #include <QString>
11 #include <QUrl>
12 
14 class QNetworkReply;
15 
16 /** Implementation of https://docs.nextcloud.com/server/latest/developer_manual/client_apis/LoginFlow/index.html#login-flow-v2. */
18 {
19  Q_OBJECT
20 public:
21  explicit NextcloudAuthenticator(QObject *parent = nullptr);
23 
24  void setNetworkAccessManager(QNetworkAccessManager *nam);
25  void authenticate(const QUrl &baseUrl, const QString &appName);
26 
27 Q_SIGNALS:
28  void authenticated(const QString &loginName, const QString &appPassword);
29 
30 private:
31  void post1Finished(QNetworkReply *reply);
32  void login2Poll();
33 
34  QNetworkAccessManager *m_nam = nullptr;
35  QUrl m_pollEndpoint;
36  QByteArray m_pollToken;
37 };
38 
39 #endif // NEXTCLOUDAUTHENTICATOR_H
Q_OBJECTQ_OBJECT
Implementation of https://docs.nextcloud.com/server/latest/developer_manual/client_apis/LoginFlow/ind...
QCA_EXPORT QString appName()
Q_SIGNALSQ_SIGNALS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Dec 11 2023 03:47:52 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.