Debian Codegraph @

ansible_collections/community/general/tests/integration/targets/keycloak_authentication/tasks/access_token.yml

raw
1 # Copyright (c) Ansible Project
2 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
3 # SPDX-License-Identifier: GPL-3.0-or-later
4 ---
5 - name: Get access token
6 ansible.builtin.uri:
7 url: "{{ url }}/realms/{{ admin_realm }}/protocol/openid-connect/token"
8 method: POST
9 status_code: 200
10 headers:
11 Accept: application/json
12 User-agent: Ansible
13 body_format: form-urlencoded
14 body:
15 grant_type: "password"
16 client_id: "admin-cli"
17 username: "{{ admin_user }}"
18 password: "{{ admin_password }}"
19 register: token_response
20 no_log: true
21
22 - name: Extract access token
23 ansible.builtin.set_fact:
24 access_token: "{{ token_response.json['access_token'] }}"
25 no_log: true