-
-
Notifications
You must be signed in to change notification settings - Fork 3k
/
qgso2.h
69 lines (53 loc) · 2.09 KB
/
qgso2.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/***************************************************************************
begin : August 1, 2016
copyright : (C) 2016 by Monsanto Company, USA
author : Larry Shaffer, Boundless Spatial
email : lshaffer at boundlessgeo dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef QGSO2_H
#define QGSO2_H
#include "o2.h"
class QgsAuthOAuth2Config;
/**
* QGIS-specific subclass of O2 lib's base OAuth 2.0 authenticator.
* Adds support for QGIS authentication system.
* \ingroup auth_plugins
* \since QGIS 3.4
*/
class QgsO2: public O2
{
Q_OBJECT
public:
/**
* Construct QgsO2
* \param authcfg authentication configuration id
* \param oauth2config OAuth2 configuration
* \param parent
* \param manager QGIS network access manager instance
*/
explicit QgsO2( const QString &authcfg, QgsAuthOAuth2Config *oauth2config = nullptr,
QObject *parent = nullptr, QNetworkAccessManager *manager = nullptr );
~QgsO2();
//! Authentication configuration id
QString authcfg() const { return mAuthcfg; }
//! OAuth2 configuration
QgsAuthOAuth2Config *oauth2config() { return mOAuth2Config; }
public slots:
//! Clear all properties
void clearProperties();
private:
void initOAuthConfig();
void setSettingsStore( bool persist = false );
void setVerificationResponseContent();
QString mTokenCacheFile;
QString mAuthcfg;
QgsAuthOAuth2Config *mOAuth2Config;
};
#endif // QGSO2_H