mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-12 17:14:22 -07:00
* Add delete_authentication_config method and integrate it into create_or_update_executions * typo * Sanity * Add integration tests for keycloak_authentication module with README, tasks, and variables * Add copyright and license information to access_token.yml * Sanity * Refactor Keycloak integration tests: streamline README, update access token task, and enhance variable management * Maj changelogs fragments --------- Co-authored-by: Andre Desrosiers <andre.desrosiers@ssss.gouv.qc.ca>
25 lines
779 B
YAML
25 lines
779 B
YAML
# Copyright (c) Ansible Project
|
|
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
---
|
|
- name: Get access token
|
|
ansible.builtin.uri:
|
|
url: "{{ url }}/realms/{{ admin_realm }}/protocol/openid-connect/token"
|
|
method: POST
|
|
status_code: 200
|
|
headers:
|
|
Accept: application/json
|
|
User-agent: Ansible
|
|
body_format: form-urlencoded
|
|
body:
|
|
grant_type: "password"
|
|
client_id: "admin-cli"
|
|
username: "{{ admin_user }}"
|
|
password: "{{ admin_password }}"
|
|
register: token_response
|
|
no_log: true
|
|
|
|
- name: Extract access token
|
|
ansible.builtin.set_fact:
|
|
access_token: "{{ token_response.json['access_token'] }}"
|
|
no_log: true
|