You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
QField supports connecting to OAuth2 protected web services. By using
9
-
OAuth2, it is possible to protect layers and services with a wide
10
-
variety of authentiaction schemes like for example two factor
11
-
authentication.
8
+
QField supports connecting to services requiring access authentication. This page will go through authentication examples as well as demonstrating how to export authentication configuration from QGIS into QField
12
9
13
-
To successfully load OAuth2-protected layer(s) in QField, the QGIS
14
-
project must be setup to use OAuth2.
10
+
## OAuth2-protected web services
15
11
16
-
## Prepare the authentication in QGIS
12
+
To successfully load OAuth2-protected layers in QField, these layers must be setup to use OAuth2 in QGIS.
13
+
14
+
### Prepare the OAuth2 authentication in QGIS
17
15
:material-monitor: Desktop preparation
18
16
19
-
To setup a WFS with OAuth2 in QGIS follow these steps in the QGIS
20
-
project configuration.
17
+
To setup a WFS with OAuth2 in QGIS follow these steps in the QGIS project configuration.
Once the layer's authentication configuration is setup, you can add layers into your project and test that the authentication mechanism works as expected. Follow instructions below to export the configuration into QField.
33
28
34
-
!!! note
35
-
Exporting an auth configuration requires at least QGIS 3.20. It is
36
-
possible to only use QGIS 3.20 to prepare the auth config and configure
37
-
the QGIS project itself with an earlier version of QGIS.
29
+
## Export authentication configurations from QGIS
30
+
:material-monitor: Desktop preparation
38
31
39
32
!!! note
40
-
It is important that the Configuration ID of the exported configuration
41
-
and the configuration stored in the QGIS project match.
33
+
Prior to exporting authentication configurations, it is always good to verify that you are able to properly connect to relevant services using QGIS.
42
34
43
-
At this point, verify that you are able to properly connect to the
44
-
service from QGIS. This authentication configuration must first be
45
-
exported from QGIS itself.
46
-
47
-
To do so, open the QGIS options dialog and focus on the
48
-
authentication panel. There, you can select the *OAuth2 configuration*
49
-
used by the project layer(s) by clicking on the appropriate row in the
50
-
configurations table widget. Then, use the lower-right
51
-
utilities button to select the *export selected authentication
52
-
configurations to file* action.
35
+
To export one or more authentication configurations, open the QGIS options dialog and select the authentication panel. There, you can select multiple authentication configurations by selecting the appropriate rows in the configurations table widget. Then, use the lower-right utilities button to select the *export selected authentication configurations to file* action.
When prompted for a password, leave it blank. You will be warned
57
-
that she might be leaking sensitive information. In the case of
58
-
OAuth2 configurations, it is safe to do so.
39
+
When prompted for a password, *leave it blank*. You will be warned that might be leaking sensitive information, which is a good reminder to treat the resulting XML with caution.
40
+
41
+
## Import authentication configurations into QField
42
+
:material-monitor: Desktop preparation
59
43
60
-
Once you have exported the authentication configuration to an XML
61
-
file, she copies that file onto the device(s) running QField. The
62
-
file has to be copied to the devices `<drive>:/Android/data/ch.opengis.qfield/files/QField/auth/` QField directory. The `/QField/auth/` path is created when first
63
-
launching QField.
44
+
Once you have exported the authentication configurations to an XML file, you must copy that file onto the devices running QField. The file has to be copied to into an `auth` folder found within the QField's app directory:
64
45
65
-
!!! note
66
-
Since QField 2 the auth files needs to be stored in the app directory `<drive>:/Android/data/ch.opengis.qfield/files/QField/auth` instead of the devices main directory `<drive>:/QField/auth`.
46
+
- On Android, you can find the directory by connecting your device using a USB cable; the directory will be located at `<drive>:/Android/data/ch.opengis.qfield/files/QField/auth/`;
47
+
- On desktop platforms, you can reach this directory by clicking on the directory path located towards the bottom of the About QField popup.
67
48
68
-
Once the authentication configuration XML file is copied, you can copy
69
-
the project file containing OAuth2-protected layer(s) onto the device(s)
70
-
and open the project in QField. You will be prompted for the
71
-
user, password, and 2-step-verification authentication code within a
72
-
browser panel that will pop up in QField itself.
49
+
Once the authentication configurations file is copied, project files containing web services requiring authentications will be able to reach the relevant configuration details and provide access.
73
50
74
-
Once authenticated, content will be rendered without the need to
75
-
re-enter user information for the duration of the session.
51
+
For authentication methods requiring user input such as OAuth2, QField will provide a browser or dialog to prompting for the required details such as user, password, or 2-step authentication code.
0 commit comments