1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-03-22 05:09:12 +00:00

keycloak_authentication_v2: verify providerIds (fix 11583) (#11585)

* 11583 verify providerIds in keycloak_authentication_v2

* 11583 code cleanup

---------

Co-authored-by: Thomas Bargetz <thomas.bargetz@rise-world.com>
This commit is contained in:
thomasbargetz 2026-03-18 07:06:09 +01:00 committed by GitHub
parent d8bb637cba
commit 25b5655be7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 118 additions and 1 deletions

View file

@ -103,6 +103,7 @@ URL_REALM_GROUP_ROLEMAPPINGS = "{url}/admin/realms/{realm}/groups/{group}/role-m
URL_CLIENTSECRET = "{url}/admin/realms/{realm}/clients/{id}/client-secret"
URL_AUTHENTICATION_AUTHENTICATOR_PROVIDERS = "{url}/admin/realms/{realm}/authentication/authenticator-providers"
URL_AUTHENTICATION_FLOWS = "{url}/admin/realms/{realm}/authentication/flows"
URL_AUTHENTICATION_FLOW = "{url}/admin/realms/{realm}/authentication/flows/{id}"
URL_AUTHENTICATION_FLOW_COPY = "{url}/admin/realms/{realm}/authentication/flows/{copyfrom}/copy"
@ -2253,6 +2254,19 @@ class KeycloakAPI:
except Exception as e:
self.fail_request(e, msg=f"Unable to delete role {name} for client {clientid} in realm {realm}: {e}")
def get_authenticator_providers(self, realm: str = "master"):
"""
Get all available authenticator providers of the realm.
:param realm: Realm.
:return: List of authenticator provider representations.
"""
try:
return self._request_and_deserialize(
URL_AUTHENTICATION_AUTHENTICATOR_PROVIDERS.format(url=self.baseurl, realm=realm), method="GET"
)
except Exception as e:
self.fail_request(e, msg=f"Unable get authenticator providers in realm {realm}: {e}")
def get_authentication_flow_by_alias(self, alias, realm: str = "master"):
"""
Get an authentication flow by its alias