Skip to content

Commit

Permalink
Merge pull request #251 from RanabirChakraborty/increase_access_token…
Browse files Browse the repository at this point in the history
…_lifespan

Access token lifespan is too short for ansible run
  • Loading branch information
guidograzioli authored Dec 11, 2024
2 parents 0d0e52f + d1859aa commit 692fb59
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jobs:
with:
fqcn: 'middleware_automation/keycloak'
molecule_tests: >-
[ "default", "overridexml", "https_revproxy", "quarkus", "quarkus-devmode", "quarkus_upgrade", "debian", "quarkus_ha" ]
[ "default", "overridexml", "https_revproxy", "quarkus", "quarkus-devmode", "quarkus_upgrade", "debian", "quarkus_ha" ]
3 changes: 3 additions & 0 deletions roles/keycloak_realm/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 14 additions & 0 deletions roles/keycloak_realm/tasks/manage_token_lifespan.yml
Original file line number Diff line number Diff line change
@@ -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 }}"

0 comments on commit 692fb59

Please sign in to comment.