element-hq / element-hq/synapse

SSO: support non-toplevel attribute_requirements

Open
#14,835 1 comment 0 reactions 0 assignees View on GitHub
A-SSO O-Uncommon S-Minor T-Enhancement
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

This issue has been migrated from [#14835](https://github.com/matrix-org/synapse/issues/14835).

---

**Description:**

To the best of my knowledge, it is only possible to configure and check attribute requirements if the attribute is in the toplevel of the claim/access token.

**Example**
We use keycloak as OIDC provider. The access token of keycloak contains:
```json
"resource_access": {
"{client-id}": {
"roles": [
"{client-role-1}",
"{client-role-2}",
]
}
},
```
I want to allow authentication based on a assigned client-role which is nested inside multiple objects.

**Possible solution**
A solution could be to allow dot-notation for the attribute requiremtes to access nested elements
```yaml
# homeserver.yaml
oidc_providers:
- idp_id: keycloak
{...}
attribute_requirements:
- attribute: resource_access.{client-id}.roles
value: {client-role-1}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.