Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'community.general.keycloak_client' token based access issue #8829

Open
1 task done
unbreakabl3 opened this issue Sep 5, 2024 · 3 comments
Open
1 task done

'community.general.keycloak_client' token based access issue #8829

unbreakabl3 opened this issue Sep 5, 2024 · 3 comments
Labels
docs module module plugins plugin (any type)

Comments

@unbreakabl3
Copy link

Summary

Following the documentation here, it is possible to use an access token instead of username and password. No matter what I am doing, I am always getting that error:

fatal: [localhost]: FAILED! => {"changed": false, "msg": "parameters are required together: auth_realm, auth_username, auth_password"}

It is forcing to provide a username and password. Is there something I am doing wrong?
The task:

- name: Create Keycloak Client
  community.general.keycloak_client:
    auth_client_id: "{{ kc_auth_client_id }}"
    auth_keycloak_url: "{{ kc_url }}"
    auth_realm: "{{ kc_auth_realm }}"
    token: "{{ keycloak_jwt_access_token }}"
    state: present
    realm: "{{ kc_auth_realm }}"
    client_id: "{{ kc_client_id }}"
  delegate_to: localhost

Issue Type

Documentation Report

Component Name

keycloak_client

Ansible Version

$ ansible --version
core 2.17.3

Community.general Version

$ ansible-galaxy collection list community.general

Configuration

$ ansible-config dump --only-changed
# /opt/homebrew/Cellar/ansible/10.3.0/libexec/lib/python3.12/site-packages/ansible_collections
Collection        Version
----------------- -------
community.general 9.3.0

OS / Environment

MacOS

Additional Information

No response

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@ansibullbot
Copy link
Collaborator

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added docs module module plugins plugin (any type) labels Sep 5, 2024
@unbreakabl3
Copy link
Author

I think I found the problem.

In the code it is mentioned that if token is provided, there is no need anything else.

module = AnsibleModule(argument_spec=argument_spec,
                           supports_check_mode=True,
                           required_one_of=([['client_id', 'id'],
                                             ['token', 'auth_realm', 'auth_username', 'auth_password']]),
                           required_together=([['auth_realm', 'auth_username', 'auth_password']]))

In the documentation examples, everywhere auth_realm is presented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs module module plugins plugin (any type)
Projects
None yet
Development

No branches or pull requests

2 participants