Skip to content

Commit bd29133

Browse files
committed
Amend authentication docs.
1 parent 6722739 commit bd29133

File tree

2 files changed

+28
-14
lines changed

2 files changed

+28
-14
lines changed

documentation/reference/qfieldcloud/logins.en.md renamed to documentation/reference/qfieldcloud/auth.en.md

+27-14
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,55 @@
11
---
2-
title: Third-party login
3-
tx_slug: documentation_reference_qfieldcloud_sso_auth
2+
title: Authentication
3+
tx_slug: documentation_reference_qfieldcloud_auth
44
---
55

6-
# Third-party authentication
6+
# Authentication
77

8-
QFieldCloud and QField / QFieldSync clients allow authentication using regular login and password, for a user that is already registered on QFieldCloud.
8+
QFieldCloud and QField / QFieldSync clients allow authentication using regular username and password, or, if configured, **OpenID Connect** with a third-party identity provider.
99

10-
It is also possible to authenticate using a third-party identity provider (e.g. Google, [OpenID Connect](https://openid.net/developers/how-connect-works/)).
10+
## OpenID Connect authentication
11+
12+
[OpenID Connect](https://openid.net/developers/how-connect-works/) (OIDC) is an industry standard authentication protocol on top of [OAuth2](https://oauth.net/2/) that allows to delegate authentication to an identity provider (IDP) such as Google, Microsoft, or any other OpenID Connect compliant provider. This allows users to log in to QFieldCloud using their existing accounts with these providers, without needing to create a separate account for QFieldCloud.
13+
14+
OIDC can be used directly for signing up with QFieldCloud, or for signing in to an existing QFieldCloud account (matched via verified email address).
1115

1216
Here is a sequence diagram of how a third-party login happens in QFieldCloud (in the browser):
1317

1418
```mermaid
1519
sequenceDiagram
1620
autonumber
1721
18-
actor User
22+
actor User as User (Browser)
1923
participant QFC as QFieldCloud
2024
2125
User ->> QFC: Access login page
2226
QFC -->> User: Display login form with configured third-party login buttons
2327
2428
User ->> QFC: Click third-party login button
2529
30+
QFC -->> User: Redirect to IDP for login
2631
create participant IDP as Identity Provider
27-
QFC ->> IDP: Redirect to IDP for login
28-
IDP -->> User: Display IDP's login form
32+
User ->> IDP: Follow redirect to IDP login page
33+
IDP -->> User: Display IDP's login page
2934
30-
User ->> IDP: Log in using IDP's credentials
31-
destroy IDP
35+
User ->> IDP: Authenticate using IDP credentials
3236
33-
IDP ->> QFC: Redirect back with auth details
37+
IDP -->> User: Redirect to QFieldCloud callback URL with authorization code
38+
User ->>+ QFC: Hand authorization code to QFieldCloud
39+
QFC ->> IDP: Exchange authorization code for access token and ID token
40+
IDP -->> QFC: Return access token + ID token
41+
42+
Note over QFC: Validate ID token signature
43+
44+
QFC ->> IDP: Request user profile information
45+
destroy IDP
46+
IDP -->> QFC: Return user profile information
3447
35-
alt User does not already have a QFieldCloud account
36-
note over QFC: QFieldCloud account is created using IDP auth details
48+
alt If user does not already have a QFieldCloud account
49+
note over QFC: QFieldCloud account is created using IDP profile infos
3750
end
3851
39-
QFC -->> User: User is logged in
52+
QFC -->>- User: Log user in (establish session)
4053
```
4154

4255
Here is a sequence diagram of how third-party authentication happens in QField and QFieldSync:

mkdocs.yml

+1
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ nav:
105105
- reference/qfieldcloud/workflow.md
106106
- reference/qfieldcloud/concepts.md
107107
- reference/qfieldcloud/projects.md
108+
- reference/qfieldcloud/auth.md
108109
- reference/qfieldcloud/permissions.md
109110
- reference/qfieldcloud/jobs.md
110111
- reference/qfieldcloud/secrets.md

0 commit comments

Comments
 (0)