From 1b7944089617c01df753c31eadefb5014e83ddc1 Mon Sep 17 00:00:00 2001 From: Gaetan2907 <48204380+Gaetan2907@users.noreply.github.com> Date: Mon, 26 Apr 2021 07:01:43 +0200 Subject: [PATCH] Fix incorrect URL_REALMS in keycloak.py (#2335) * Allow keycloak_group.py to take token as parameter for the authentification * Refactor get_token to pass module.params + Documentation * Fix unit test and add new one for token as param * Fix identation * Update plugins/modules/identity/keycloak/keycloak_client.py Co-authored-by: Felix Fontein * Update plugins/modules/identity/keycloak/keycloak_clienttemplate.py Co-authored-by: Felix Fontein * Allow keycloak_group.py to take token as parameter for the authentification * Refactor get_token to pass module.params + Documentation * Update plugins/module_utils/identity/keycloak/keycloak.py Co-authored-by: Felix Fontein * Check if base_url is None before to check format * Update plugins/module_utils/identity/keycloak/keycloak.py Co-authored-by: Felix Fontein * Update plugins/modules/identity/keycloak/keycloak_client.py Co-authored-by: Amin Vakil * Update plugins/modules/identity/keycloak/keycloak_clienttemplate.py Co-authored-by: Amin Vakil * Switch to modern syntax for the documentation (e.g. community.general.keycloak_client) * Fix URL_REALMS in keycloak.py * Update keycloak_client.py * Update keycloak_clienttemplate.py * Update plugins/module_utils/identity/keycloak/keycloak.py Co-authored-by: Felix Fontein Co-authored-by: Felix Fontein Co-authored-by: Amin Vakil --- plugins/module_utils/identity/keycloak/keycloak.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/module_utils/identity/keycloak/keycloak.py b/plugins/module_utils/identity/keycloak/keycloak.py index 082e0af391..c0a1c2a158 100644 --- a/plugins/module_utils/identity/keycloak/keycloak.py +++ b/plugins/module_utils/identity/keycloak/keycloak.py @@ -37,8 +37,8 @@ from ansible.module_utils.six.moves.urllib.parse import urlencode from ansible.module_utils.six.moves.urllib.error import HTTPError from ansible.module_utils._text import to_native -URL_REALMS = "{url}/realms" -URL_REALM = "{url}/realms/{realm}" +URL_REALMS = "{url}/admin/realms" +URL_REALM = "{url}/admin/realms/{realm}" URL_TOKEN = "{url}/realms/{realm}/protocol/openid-connect/token" URL_CLIENT = "{url}/admin/realms/{realm}/clients/{id}"