mirror of
https://github.com/ansible-middleware/keycloak.git
synced 2025-04-05 10:20:27 -07:00
Merge pull request #251 from RanabirChakraborty/increase_access_token_lifespan
Access token lifespan is too short for ansible run
This commit is contained in:
commit
692fb59797
3 changed files with 18 additions and 1 deletions
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
|
@ -16,4 +16,4 @@ jobs:
|
||||||
with:
|
with:
|
||||||
fqcn: 'middleware_automation/keycloak'
|
fqcn: 'middleware_automation/keycloak'
|
||||||
molecule_tests: >-
|
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" ]
|
||||||
|
|
|
@ -110,3 +110,6 @@
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: client
|
loop_var: client
|
||||||
when: "'users' in client"
|
when: "'users' in client"
|
||||||
|
|
||||||
|
- name: Provide Access token lifespan
|
||||||
|
ansible.builtin.include_tasks: manage_token_lifespan.yml
|
||||||
|
|
14
roles/keycloak_realm/tasks/manage_token_lifespan.yml
Normal file
14
roles/keycloak_realm/tasks/manage_token_lifespan.yml
Normal 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 }}"
|
Loading…
Add table
Reference in a new issue