Merge pull request #251 from RanabirChakraborty/increase_access_token_lifespan

Access token lifespan is too short for ansible run
This commit is contained in:
Guido Grazioli 2024-12-11 16:19:13 +01:00 committed by GitHub
commit 692fb59797
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 18 additions and 1 deletions

View file

@ -110,3 +110,6 @@
loop_control:
loop_var: client
when: "'users' in client"
- name: Provide Access token lifespan
ansible.builtin.include_tasks: manage_token_lifespan.yml

View file

@ -0,0 +1,14 @@
---
- name: "Update Access token lifespan"
ansible.builtin.uri:
url: "{{ keycloak_url }}{{ keycloak_context }}/admin/realms/{{ keycloak_realm }}"
method: PUT
body:
accessTokenLifespan: 300
validate_certs: false
body_format: json
status_code:
- 200
- 204
headers:
Authorization: "Bearer {{ keycloak_auth_response.json.access_token }}"