File indexing completed on 2024-04-28 16:11:05

0001 /*
0002    SPDX-FileCopyrightText: 2020-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "libruqolacore_export.h"
0010 #include <QObject>
0011 namespace RocketChatRestApi
0012 {
0013 class Connection;
0014 }
0015 class LIBRUQOLACORE_EXPORT RESTAuthenticationManager : public QObject
0016 {
0017     Q_OBJECT
0018 public:
0019     explicit RESTAuthenticationManager(RocketChatRestApi::Connection *restApiConnection, QObject *parent = nullptr);
0020     ~RESTAuthenticationManager() override;
0021 
0022     void login();
0023     void login(const QString &user, const QString &password);
0024     void loginLDAP(const QString &user, const QString &password); // TODO: LDAP options?
0025     void loginOAuth(const QString &credentialToken, const QString &credentialSecret);
0026     void sendOTP(const QString &otp);
0027     void logout();
0028 
0029     void setAuthToken(const QString &authToken);
0030 
0031 private:
0032     QString mAuthToken;
0033     RocketChatRestApi::Connection *const mRestApiConnection;
0034 };