Skip to content

Commit d0cf8b6

Browse files
authored
Merge pull request #535 from opengisch/authentication_imp
Improve the authentication documentation
2 parents d8f601c + a160df7 commit d0cf8b6

File tree

1 file changed

+21
-45
lines changed

1 file changed

+21
-45
lines changed

documentation/how-to/authentication.en.md

Lines changed: 21 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -5,71 +5,47 @@ tx_slug: documentation_how-to_authentication
55

66
# Authentication
77

8-
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
129

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
1511

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
1715
:material-monitor: Desktop preparation
1816

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.
2118

2219
In the WFS layer configuration:
2320

2421
!![widgets](../assets/images/oauth2_setup_wfs.png)
2522

26-
Add a new authentication configuration. Parameters need to be adjusted
27-
to the OAuth2 server setup:
23+
Add a new authentication configuration and adjust parameters to match your OAuth2 server setup:
2824

2925
!![widgets](../assets/images/oauth2_setup_auth.png)
3026

31-
## Export the authentication from QGIS
32-
:material-monitor: Desktop preparation
27+
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.
3328

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
3831

3932
!!! 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.
4234

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.
5336

5437
!![widgets](../assets/images/oauth2_export_config.png)
5538

56-
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
5943

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:
6445

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.
6748

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.
7350

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

Comments
 (0)