keycloak_userprofile: support required.scopes

Keycloak can require a user profile attribute only when one of the given
client scopes is requested, but the module's argument spec only accepted
required.roles and rejected required.scopes.
This commit is contained in:
Aleksandr Mangin
2026-11-02 20:21:31 +01:00
parent d172eb9236
commit 2a7834c5e4
3 changed files with 58 additions and 1 deletions
+12 -1
View File
@@ -257,6 +257,13 @@ options:
default:
- user
scopes:
description:
- The client scopes for which this attribute is required.
- If not set, the attribute is required regardless of the requested scopes.
type: list
elements: str
selector:
description:
- Selector when the attribute should be added.
@@ -583,7 +590,11 @@ def main():
),
"multivalued": dict(type="bool", default=False),
"required": dict(
type="dict", options={"roles": dict(type="list", elements="str", default=["user"])}
type="dict",
options={
"roles": dict(type="list", elements="str", default=["user"]),
"scopes": dict(type="list", elements="str"),
},
),
"selector": dict(type="dict", options={"scopes": dict(type="list", elements="str")}),
},