mirror of
https://github.com/ansible-middleware/keycloak.git
synced 2026-11-24 18:03:48 +00:00
AMW-625 add use_netrc option to prevent .netrc overriding bearer token auth
When ~/.netrc contains an entry matching the Keycloak host, open_url() silently replaces the OIDC Bearer header with Basic auth, causing 401 errors. Add use_netrc option (default false) to all keycloak modules and pass it through to both open_url() call sites. Includes molecule test scenario (netrc) that verifies both behaviors: - default use_netrc=false ignores .netrc (fix works) - use_netrc=true picks up .netrc and gets 401 (proves the bug) Fixes: https://github.com/ansible-middleware/keycloak/issues/403
This commit is contained in:
@@ -78,4 +78,12 @@ options:
|
||||
- Configures the HTTP User-Agent header.
|
||||
type: str
|
||||
default: Ansible
|
||||
use_netrc:
|
||||
description:
|
||||
- Whether to use credentials from C(~/.netrc) file.
|
||||
- By default, C(~/.netrc) is not used because these modules authenticate via
|
||||
explicit OIDC credentials/token. A matching C(~/.netrc) entry would silently
|
||||
override the Bearer token with Basic authentication, causing 401 errors.
|
||||
type: bool
|
||||
default: false
|
||||
'''
|
||||
|
||||
Reference in New Issue
Block a user