Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[keycloak_user_federation]: Adding option krbPrincipalAttribute #7538

Merged
merged 5 commits into from
Nov 26, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- keycloak_user_federation module - Add option for krbPrincipalAttribute (https://github.com/ansible-collections/community.general/pull/7538)
Boolman marked this conversation as resolved.
Show resolved Hide resolved
9 changes: 9 additions & 0 deletions plugins/modules/keycloak_user_federation.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,14 @@
- Name of kerberos realm.
type: str

krbPrincipalAttribute:
description:
- Name of the LDAP attribute, which refers to Kerberos principal.
This is used to lookup appropriate LDAP user after successful Kerberos/SPNEGO authentication in Keycloak.
When this is empty, the LDAP user will be looked based on LDAP username corresponding
to the first part of his Kerberos principal. For instance, for principal 'john@KEYCLOAK.ORG',
it will assume that LDAP username is 'john'.
Boolman marked this conversation as resolved.
Show resolved Hide resolved
type: str
Boolman marked this conversation as resolved.
Show resolved Hide resolved
serverPrincipal:
description:
- Full name of server principal for HTTP service including server and domain name. For
Expand Down Expand Up @@ -764,6 +772,7 @@ def main():
readTimeout=dict(type='int'),
searchScope=dict(type='str', choices=['1', '2'], default='1'),
serverPrincipal=dict(type='str'),
krbPrincipalAttribute=dict(type='str'),
startTls=dict(type='bool', default=False),
syncRegistrations=dict(type='bool', default=False),
trustEmail=dict(type='bool', default=False),
Expand Down
4 changes: 4 additions & 0 deletions tests/unit/plugins/modules/test_keycloak_user_federation.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ def test_create_with_mappers(self):
'connectionPooling': True,
'pagination': True,
'allowKerberosAuthentication': False,
'krbPrincipalAttribute': 'krbPrincipalName',
'debug': False,
'useKerberosForPasswordAuthentication': False,
},
Expand Down Expand Up @@ -374,6 +375,9 @@ def test_create_with_mappers(self):
"enabled": [
"true"
],
"krbPrincipalAttribute": [
"krb5PrincipalName"
],
"usernameLDAPAttribute": [
"uid"
],
Expand Down