I have spent a bit of time and finally have kerberos authentication via SAML, Keycloak and FreeIPA working for AWX 17.1.0 for the web UI.
What I really want to get working though is API access from curl or ansible, without needing to pass username and password in. Is there a guide somewhere for this part? My hunting so far is looking like I need to create tokens to do any API work without usernames and passwords, and for that I would need to use the web UI to create the tokens if I want to do it with SAML auth, which feels like something is missing.
In case anyone else comes looking for this (https://xkcd.com/979/), here is where I have got to:
GET request to AWX SAML redirect, following redirections and using SPNEGO to pass kerberos credentials and cookie storage
returns an HTML form with a SAMLResponse field (base64 encoded SAML XML response) and javascript to submit the form if in a browser, also sets an AWX sessionid cookie and various Keycloak cookies
Yes, I did get some ansible tasks working for our environment on Linux. A bit clunky, but we haven’t spent too much more time on it and are now moving away from AWX. I have pasted some code snippets below.
We get a session cookie and csrftoken for the AWX host and store it in the hostvars for that AWX host.
name: Get initial awx sessionid and SAMLRequest
block:
skip_ansible_lint # get_uri module does not support SPNEGO/kerberos authentication
name: Assert that we received a SAMLResponse
assert:
that: “‘SAMLResponse’ in awx_session_saml_response.stdout”
fail_msg: “Did not receive a SAMLResponse from keycloak server”
success_msg: “Keycloak authentication successful”