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

azure_rm_accesstoken_info leads to TypeError: Session.request() got an unexpected keyword argument 'claims' #1540

Closed
RoFz opened this issue Apr 23, 2024 · 4 comments · Fixed by #1541
Labels
bug Something isn't working has_pr PR fixes have been made medium_priority Medium priority work in In trying to solve, or in working with contributors

Comments

@RoFz
Copy link

RoFz commented Apr 23, 2024

SUMMARY

azure_rm_accesstoken_info leads to TypeError: Session.request() got an unexpected keyword argument 'claims'

ISSUE TYPE
  • Bug Report
COMPONENT NAME

azure.azcollection.azure_rm_accesstoken_info module

ANSIBLE VERSION
ansible [core 2.16.6]
  config file = None
  configured module search path = ['/Users/rofz/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/rofz/python-envs/3.11/ansible/lib/python3.11/site-packages/ansible
  ansible collection location = /Users/rofz/.ansible/collections:/usr/share/ansible/collections
  executable location = /Users/rofz/python-envs/3.11/ansible/bin/ansible
  python version = 3.11.9 (main, Apr  2 2024, 08:25:04) [Clang 15.0.0 (clang-1500.1.0.2.5)] (/Users/rofz/python-envs/3.11/ansible/bin/python3)
  jinja version = 3.1.3
  libyaml = True
COLLECTION VERSION
# /Users/rofz/python-envs/3.11/ansible/lib/python3.11/site-packages/ansible_collections
Collection         Version
------------------ -------
azure.azcollection 2.3.0  
CONFIGURATION
CONFIG_FILE() = None
PAGER(env: PAGER) = less
OS / ENVIRONMENT

MacOS Ventura 13.6.6

STEPS TO REPRODUCE
python3 -m venv ansible
source ansible/bin/activate
python3 -m pip install ansible 
ansible-galaxy collection install azure.azcollection --force
pip3 install -r ansible/lib/python3.11/site-packages/ansible_collections/azure/azcollection/requirements-azure.txt
ansible-playbook playbook.yaml

playbook 1 - my actual objective:

---
- hosts: localhost
  connection: local
  collections:
   - azure.azcollection
  tasks:

    - name: Retrieve JWT
      azure_rm_accesstoken_info:
        scopes:
          - https://ossrdbms-aad.database.windows.net
      register: PGPASSWORD
    
    - name: Output Azure DB JWT
      debug:
        var: PGPASSWORD

playbook 2 - also fails with the same error:

---
- hosts: localhost
  connection: local
  collections:
   - azure.azcollection
  tasks:

    - name: Retrieve JWT
      azure_rm_accesstoken_info:
        auth_source: cli
        scopes:
          - https://graph.microsoft.com/.default
      register: JWT
    
    - name: Output Azure DB JWT
      debug:
        var: JWT
EXPECTED RESULTS

Successfully retrieve an accessToken.

ACTUAL RESULTS
ansible-playbook [core 2.16.6]
  config file = None
  configured module search path = ['/Users/rofz/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/rofz/python-envs/3.11/ansible/lib/python3.11/site-packages/ansible
  ansible collection location = /Users/rofz/.ansible/collections:/usr/share/ansible/collections
  executable location = /Users/rofz/python-envs/3.11/ansible/bin/ansible-playbook
  python version = 3.11.9 (main, Apr  2 2024, 08:25:04) [Clang 15.0.0 (clang-1500.1.0.2.5)] (/Users/rofz/python-envs/3.11/ansible/bin/python3)
  jinja version = 3.1.3
  libyaml = True
No config file found; using defaults
setting up inventory plugins
Loading collection ansible.builtin from 
host_list declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
script declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
auto declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
yaml declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
ini declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
toml declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
Loading collection azure.azcollection from /Users/rofz/python-envs/3.11/ansible/lib/python3.11/site-packages/ansible_collections/azure/azcollection
Loading callback plugin default of type stdout, v2.0 from /Users/rofz/python-envs/3.11/ansible/lib/python3.11/site-packages/ansible/plugins/callback/default.py
Skipping callback 'default', as we already have a stdout callback.
Skipping callback 'minimal', as we already have a stdout callback.
Skipping callback 'oneline', as we already have a stdout callback.

PLAYBOOK: playbook.yaml ************************************************************************************************************************************************************************************************************************************************************************
Positional arguments: playbook.yaml
verbosity: 4
connection: ssh
become_method: sudo
tags: ('all',)
inventory: ('/etc/ansible/hosts',)
forks: 5
1 plays in playbook.yaml

PLAY [localhost] *******************************************************************************************************************************************************************************************************************************************************************************

TASK [Gathering Facts] *************************************************************************************************************************************************************************************************************************************************************************
task path: /Users/rofz/Documents/GitHub/<redacted>/<redacted>/deployment/configmgmt/sandbox/pgsql-mi-roles/playbook.yaml:2
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: rofz
<127.0.0.1> EXEC /bin/sh -c 'echo ~rofz && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /Users/rofz/.ansible/tmp `"&& mkdir "` echo /Users/rofz/.ansible/tmp/ansible-tmp-1713911068.0817542-17463-39873169860550 `" && echo ansible-tmp-1713911068.0817542-17463-39873169860550="` echo /Users/rofz/.ansible/tmp/ansible-tmp-1713911068.0817542-17463-39873169860550 `" ) && sleep 0'
Using module file /Users/rofz/python-envs/3.11/ansible/lib/python3.11/site-packages/ansible/modules/setup.py
<127.0.0.1> PUT /Users/rofz/.ansible/tmp/ansible-local-17461evhb500q/tmpmaxn2wco TO /Users/rofz/.ansible/tmp/ansible-tmp-1713911068.0817542-17463-39873169860550/AnsiballZ_setup.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /Users/rofz/.ansible/tmp/ansible-tmp-1713911068.0817542-17463-39873169860550/ /Users/rofz/.ansible/tmp/ansible-tmp-1713911068.0817542-17463-39873169860550/AnsiballZ_setup.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/Users/rofz/python-envs/3.11/ansible/bin/python3 /Users/rofz/.ansible/tmp/ansible-tmp-1713911068.0817542-17463-39873169860550/AnsiballZ_setup.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /Users/rofz/.ansible/tmp/ansible-tmp-1713911068.0817542-17463-39873169860550/ > /dev/null 2>&1 && sleep 0'
ok: [localhost]

TASK [Retrieve JWT] ****************************************************************************************************************************************************************************************************************************************************************************
task path: /Users/rofz/Documents/GitHub/<redacted>/<redacted>/deployment/configmgmt/sandbox/pgsql-mi-roles/playbook.yaml:8
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: rofz
<127.0.0.1> EXEC /bin/sh -c 'echo ~rofz && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /Users/rofz/.ansible/tmp `"&& mkdir "` echo /Users/rofz/.ansible/tmp/ansible-tmp-1713911070.597146-17500-239599628201950 `" && echo ansible-tmp-1713911070.597146-17500-239599628201950="` echo /Users/rofz/.ansible/tmp/ansible-tmp-1713911070.597146-17500-239599628201950 `" ) && sleep 0'
Using module file /Users/rofz/python-envs/3.11/ansible/lib/python3.11/site-packages/ansible_collections/azure/azcollection/plugins/modules/azure_rm_accesstoken_info.py
<127.0.0.1> PUT /Users/rofz/.ansible/tmp/ansible-local-17461evhb500q/tmp7obr89qd TO /Users/rofz/.ansible/tmp/ansible-tmp-1713911070.597146-17500-239599628201950/AnsiballZ_azure_rm_accesstoken_info.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /Users/rofz/.ansible/tmp/ansible-tmp-1713911070.597146-17500-239599628201950/ /Users/rofz/.ansible/tmp/ansible-tmp-1713911070.597146-17500-239599628201950/AnsiballZ_azure_rm_accesstoken_info.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/Users/rofz/python-envs/3.11/ansible/bin/python3 /Users/rofz/.ansible/tmp/ansible-tmp-1713911070.597146-17500-239599628201950/AnsiballZ_azure_rm_accesstoken_info.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /Users/rofz/.ansible/tmp/ansible-tmp-1713911070.597146-17500-239599628201950/ > /dev/null 2>&1 && sleep 0'
The full traceback is:
Traceback (most recent call last):
  File "/Users/rofz/.ansible/tmp/ansible-tmp-1713911070.597146-17500-239599628201950/AnsiballZ_azure_rm_accesstoken_info.py", line 107, in <module>
    _ansiballz_main()
  File "/Users/rofz/.ansible/tmp/ansible-tmp-1713911070.597146-17500-239599628201950/AnsiballZ_azure_rm_accesstoken_info.py", line 99, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/Users/rofz/.ansible/tmp/ansible-tmp-1713911070.597146-17500-239599628201950/AnsiballZ_azure_rm_accesstoken_info.py", line 47, in invoke_module
    runpy.run_module(mod_name='ansible_collections.azure.azcollection.plugins.modules.azure_rm_accesstoken_info', init_globals=dict(_module_fqn='ansible_collections.azure.azcollection.plugins.modules.azure_rm_accesstoken_info', _modlib_path=modlib_path),
  File "<frozen runpy>", line 226, in run_module
  File "<frozen runpy>", line 98, in _run_module_code
  File "<frozen runpy>", line 88, in _run_code
  File "/var/folders/_z/rlvv3qp94_56nlxyxlryddcm0000gn/T/ansible_azure_rm_accesstoken_info_payload_69ivh_wu/ansible_azure_rm_accesstoken_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_accesstoken_info.py", line 126, in <module>
  File "/var/folders/_z/rlvv3qp94_56nlxyxlryddcm0000gn/T/ansible_azure_rm_accesstoken_info_payload_69ivh_wu/ansible_azure_rm_accesstoken_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_accesstoken_info.py", line 122, in main
  File "/var/folders/_z/rlvv3qp94_56nlxyxlryddcm0000gn/T/ansible_azure_rm_accesstoken_info_payload_69ivh_wu/ansible_azure_rm_accesstoken_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_accesstoken_info.py", line 95, in __init__
  File "/var/folders/_z/rlvv3qp94_56nlxyxlryddcm0000gn/T/ansible_azure_rm_accesstoken_info_payload_69ivh_wu/ansible_azure_rm_accesstoken_info_payload.zip/ansible_collections/azure/azcollection/plugins/module_utils/azure_rm_common.py", line 475, in __init__
  File "/var/folders/_z/rlvv3qp94_56nlxyxlryddcm0000gn/T/ansible_azure_rm_accesstoken_info_payload_69ivh_wu/ansible_azure_rm_accesstoken_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_accesstoken_info.py", line 109, in exec_module
  File "/Users/rofz/python-envs/3.11/ansible/lib/python3.11/site-packages/azure/cli/core/auth/credential_adaptor.py", line 65, in get_token
    token, _ = self._get_token(scopes, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rofz/python-envs/3.11/ansible/lib/python3.11/site-packages/azure/cli/core/auth/credential_adaptor.py", line 38, in _get_token
    token = self._credential.get_token(*scopes, **kwargs)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rofz/python-envs/3.11/ansible/lib/python3.11/site-packages/azure/cli/core/auth/msal_authentication.py", line 60, in get_token
    result = self.acquire_token_silent_with_error(list(scopes), self._account, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rofz/python-envs/3.11/ansible/lib/python3.11/site-packages/msal/application.py", line 1284, in acquire_token_silent_with_error
    return _clean_up(self._acquire_token_silent_with_error(
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rofz/python-envs/3.11/ansible/lib/python3.11/site-packages/msal/application.py", line 1307, in _acquire_token_silent_with_error
    result = self._acquire_token_silent_from_cache_and_possibly_refresh_it(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rofz/python-envs/3.11/ansible/lib/python3.11/site-packages/msal/application.py", line 1438, in _acquire_token_silent_from_cache_and_possibly_refresh_it
    result = self._acquire_token_silent_by_finding_rt_belongs_to_me_or_my_family(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rofz/python-envs/3.11/ansible/lib/python3.11/site-packages/msal/application.py", line 1499, in _acquire_token_silent_by_finding_rt_belongs_to_me_or_my_family
    last_resp = at = self._acquire_token_silent_by_finding_specific_refresh_token(
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rofz/python-envs/3.11/ansible/lib/python3.11/site-packages/msal/application.py", line 1547, in _acquire_token_silent_by_finding_specific_refresh_token
    response = client.obtain_token_by_refresh_token(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rofz/python-envs/3.11/ansible/lib/python3.11/site-packages/msal/oauth2cli/oauth2.py", line 830, in obtain_token_by_refresh_token
    resp = super(Client, self).obtain_token_by_refresh_token(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rofz/python-envs/3.11/ansible/lib/python3.11/site-packages/msal/oauth2cli/oauth2.py", line 262, in obtain_token_by_refresh_token
    return self._obtain_token("refresh_token", data=data, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rofz/python-envs/3.11/ansible/lib/python3.11/site-packages/msal/oauth2cli/oidc.py", line 170, in _obtain_token
    ret = super(Client, self)._obtain_token(grant_type, *args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rofz/python-envs/3.11/ansible/lib/python3.11/site-packages/msal/oauth2cli/oauth2.py", line 771, in _obtain_token
    resp = super(Client, self)._obtain_token(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rofz/python-envs/3.11/ansible/lib/python3.11/site-packages/msal/oauth2cli/oauth2.py", line 234, in _obtain_token
    resp = (post or self._http_client.post)(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rofz/python-envs/3.11/ansible/lib/python3.11/site-packages/msal/individual_cache.py", line 269, in wrapper
    value = function(*args, **kwargs)
            ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rofz/python-envs/3.11/ansible/lib/python3.11/site-packages/msal/individual_cache.py", line 269, in wrapper
    value = function(*args, **kwargs)
            ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rofz/python-envs/3.11/ansible/lib/python3.11/site-packages/requests/sessions.py", line 637, in post
    return self.request("POST", url, data=data, json=json, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Session.request() got an unexpected keyword argument 'claims'
fatal: [localhost]: FAILED! => {
    "changed": false,
    "module_stderr": "Traceback (most recent call last):\n  File \"/Users/rofz/.ansible/tmp/ansible-tmp-1713911070.597146-17500-239599628201950/AnsiballZ_azure_rm_accesstoken_info.py\", line 107, in <module>\n    _ansiballz_main()\n  File \"/Users/rofz/.ansible/tmp/ansible-tmp-1713911070.597146-17500-239599628201950/AnsiballZ_azure_rm_accesstoken_info.py\", line 99, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/Users/rofz/.ansible/tmp/ansible-tmp-1713911070.597146-17500-239599628201950/AnsiballZ_azure_rm_accesstoken_info.py\", line 47, in invoke_module\n    runpy.run_module(mod_name='ansible_collections.azure.azcollection.plugins.modules.azure_rm_accesstoken_info', init_globals=dict(_module_fqn='ansible_collections.azure.azcollection.plugins.modules.azure_rm_accesstoken_info', _modlib_path=modlib_path),\n  File \"<frozen runpy>\", line 226, in run_module\n  File \"<frozen runpy>\", line 98, in _run_module_code\n  File \"<frozen runpy>\", line 88, in _run_code\n  File \"/var/folders/_z/rlvv3qp94_56nlxyxlryddcm0000gn/T/ansible_azure_rm_accesstoken_info_payload_69ivh_wu/ansible_azure_rm_accesstoken_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_accesstoken_info.py\", line 126, in <module>\n  File \"/var/folders/_z/rlvv3qp94_56nlxyxlryddcm0000gn/T/ansible_azure_rm_accesstoken_info_payload_69ivh_wu/ansible_azure_rm_accesstoken_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_accesstoken_info.py\", line 122, in main\n  File \"/var/folders/_z/rlvv3qp94_56nlxyxlryddcm0000gn/T/ansible_azure_rm_accesstoken_info_payload_69ivh_wu/ansible_azure_rm_accesstoken_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_accesstoken_info.py\", line 95, in __init__\n  File \"/var/folders/_z/rlvv3qp94_56nlxyxlryddcm0000gn/T/ansible_azure_rm_accesstoken_info_payload_69ivh_wu/ansible_azure_rm_accesstoken_info_payload.zip/ansible_collections/azure/azcollection/plugins/module_utils/azure_rm_common.py\", line 475, in __init__\n  File \"/var/folders/_z/rlvv3qp94_56nlxyxlryddcm0000gn/T/ansible_azure_rm_accesstoken_info_payload_69ivh_wu/ansible_azure_rm_accesstoken_info_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_accesstoken_info.py\", line 109, in exec_module\n  File \"/Users/rofz/python-envs/3.11/ansible/lib/python3.11/site-packages/azure/cli/core/auth/credential_adaptor.py\", line 65, in get_token\n    token, _ = self._get_token(scopes, **kwargs)\n               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/Users/rofz/python-envs/3.11/ansible/lib/python3.11/site-packages/azure/cli/core/auth/credential_adaptor.py\", line 38, in _get_token\n    token = self._credential.get_token(*scopes, **kwargs)\n            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/Users/rofz/python-envs/3.11/ansible/lib/python3.11/site-packages/azure/cli/core/auth/msal_authentication.py\", line 60, in get_token\n    result = self.acquire_token_silent_with_error(list(scopes), self._account, **kwargs)\n             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/Users/rofz/python-envs/3.11/ansible/lib/python3.11/site-packages/msal/application.py\", line 1284, in acquire_token_silent_with_error\n    return _clean_up(self._acquire_token_silent_with_error(\n                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/Users/rofz/python-envs/3.11/ansible/lib/python3.11/site-packages/msal/application.py\", line 1307, in _acquire_token_silent_with_error\n    result = self._acquire_token_silent_from_cache_and_possibly_refresh_it(\n             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/Users/rofz/python-envs/3.11/ansible/lib/python3.11/site-packages/msal/application.py\", line 1438, in _acquire_token_silent_from_cache_and_possibly_refresh_it\n    result = self._acquire_token_silent_by_finding_rt_belongs_to_me_or_my_family(\n             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/Users/rofz/python-envs/3.11/ansible/lib/python3.11/site-packages/msal/application.py\", line 1499, in _acquire_token_silent_by_finding_rt_belongs_to_me_or_my_family\n    last_resp = at = self._acquire_token_silent_by_finding_specific_refresh_token(\n                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/Users/rofz/python-envs/3.11/ansible/lib/python3.11/site-packages/msal/application.py\", line 1547, in _acquire_token_silent_by_finding_specific_refresh_token\n    response = client.obtain_token_by_refresh_token(\n               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/Users/rofz/python-envs/3.11/ansible/lib/python3.11/site-packages/msal/oauth2cli/oauth2.py\", line 830, in obtain_token_by_refresh_token\n    resp = super(Client, self).obtain_token_by_refresh_token(\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/Users/rofz/python-envs/3.11/ansible/lib/python3.11/site-packages/msal/oauth2cli/oauth2.py\", line 262, in obtain_token_by_refresh_token\n    return self._obtain_token(\"refresh_token\", data=data, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/Users/rofz/python-envs/3.11/ansible/lib/python3.11/site-packages/msal/oauth2cli/oidc.py\", line 170, in _obtain_token\n    ret = super(Client, self)._obtain_token(grant_type, *args, **kwargs)\n          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/Users/rofz/python-envs/3.11/ansible/lib/python3.11/site-packages/msal/oauth2cli/oauth2.py\", line 771, in _obtain_token\n    resp = super(Client, self)._obtain_token(\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/Users/rofz/python-envs/3.11/ansible/lib/python3.11/site-packages/msal/oauth2cli/oauth2.py\", line 234, in _obtain_token\n    resp = (post or self._http_client.post)(\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/Users/rofz/python-envs/3.11/ansible/lib/python3.11/site-packages/msal/individual_cache.py\", line 269, in wrapper\n    value = function(*args, **kwargs)\n            ^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/Users/rofz/python-envs/3.11/ansible/lib/python3.11/site-packages/msal/individual_cache.py\", line 269, in wrapper\n    value = function(*args, **kwargs)\n            ^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/Users/rofz/python-envs/3.11/ansible/lib/python3.11/site-packages/requests/sessions.py\", line 637, in post\n    return self.request(\"POST\", url, data=data, json=json, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nTypeError: Session.request() got an unexpected keyword argument 'claims'\n",
    "module_stdout": "",
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
    "rc": 1
}

PLAY RECAP *************************************************************************************************************************************************************************************************************************************************************************************
localhost                  : ok=1    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0   


@RoFz
Copy link
Author

RoFz commented Apr 23, 2024

Might be (indirectly) related to #1413.

@Fred-sun
Copy link
Collaborator

@RoFz Can you try PR #1541, maybe it can solve your problem! Thank you!

@Fred-sun Fred-sun added bug Something isn't working medium_priority Medium priority work in In trying to solve, or in working with contributors has_pr PR fixes have been made labels Apr 24, 2024
@RoFz
Copy link
Author

RoFz commented Apr 24, 2024

@Fred-sun PR #1541 confirmedly solved the problem. Thank you!

@Fred-sun
Copy link
Collaborator

@RoFz Thanks for your feedback! I will push merged as soon as possible!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working has_pr PR fixes have been made medium_priority Medium priority work in In trying to solve, or in working with contributors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants