qfieldsync
qfieldsync copied to clipboard
[WIP] External auth providers implementation
This PR intends to add Single Sign-On login capabilities to QFieldSync.
Current status is WIP.
Requirements
- have a QGIS where this PR adding extra-tokens to OAuth2 configs is applied
UI changes
This is a first draft here, nothing is fixed in stone, very open to discussion and propositions.
- on first login, the dialog only displays the server URL:
- when updating the server URL, the auth methods are fetched from the targeted QFieldCloud server (
/api/v1/auth/providers/endpoint), and the UI is adapted accordingly :
Google / Keycloak / OAuth2 methods are dynamically created.
- clicking on
GoogleorOpenIDcreates and stores a newQgsAuthMethodConfig, that should be used later on when sending someQNetworkRequestto the QFieldCloud server, using theQtNetworkframework. So we rely on QGIS'sQgsAuthManagersingleton instance to update all requests to QFieldCloud, using the customized OAuth2 config.