Skip to content

Conversation

@SeqLaz
Copy link
Member

@SeqLaz SeqLaz commented Jan 9, 2026

No description provided.

@SeqLaz SeqLaz requested review from beanzmo and gounux January 9, 2026 19:41
@duke-nyuki
Copy link

Copy link
Member

@gounux gounux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @SeqLaz 🦾 !

I guess that the screenshot needs to be changed, also I'm wondering if we should detail more the Session ROLE QGIS part, e.g. maybe with a use case ?

SeqLaz and others added 2 commits January 10, 2026 01:00
Co-authored-by: Guilhem Allaman <40383801+gounux@users.noreply.github.com>
@SeqLaz SeqLaz requested a review from gounux January 10, 2026 16:42
Copy link
Member

@gounux gounux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @SeqLaz, here is another review round,

Some things are to be clarified IMO, before getting this merged,

And thank you for this updated + QGIS screenshots !

GRANT user_mielena TO qfield_service;
```

**QGIS Configuration:** In the QGIS Connection setup, you connect as `qfield_service`, but in the "Session role" field, you enter `user_mielena`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that the idea here could be to keep a generic role in the QGIS PostGIS connection - so maybe a role like admin, qfield_admin or anything more relevant, describing a pg role that has let's say "a lot of grants / powers". Then, the Session Role overriding would happen in the QFieldCloud workers, making use of this QFC_PG_EFFECTIVE_USER Secret.

So I'd maybe not advise to put a Session ROLE in the QGIS connection, since that would be more to happen in QFieldCloud Secrets.

But this is the use case I have in mind, OFC QFC users are free to play with this feature and set a Session ROLE in the QGIS connection.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally agree, so I restructured and added a complete example and made some rephrasing. please have a look. 🥷

Comment on lines 110 to 117
In QGIS, the **Session ROLE** setting allows you to separate **authentication** (logging in) from **authorization** (permissions and identity).
This utilizes the PostgreSQL `SET ROLE` command.

!![Setting session ROLE in QGIS](../../assets/images/set_session_role_in_qgis.png)

**Use Case: Simplified User Management & Auditing**

Imagine in the organization with field workers. Managing many unique passwords and updating them in QFieldCloud Secrets is inefficient. Instead, you can use a **Proxy Authentication** approach:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before assessing this, I'd ask for @lukasgraf's thoughts here, our senior auth* expert :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants