Hello,
we use Ansible AWX 22.7.1, Keycloak 22.0.5 and our own web application and backend services.
In AWX we set the settings for Generic OIDC settings to our Keycloak server.
We can login-in to the web-app over keycloak. So the user is authenticated.
In our web-app we make a call to the backend. The backend calls the AWX service.
Our problem now is, that we don’t know how to authenticate on the awx service with the generated access token from keycloak to start a template for example.
We also found out, that we can allow external users to create tokens. ansible-tower oauth2_token_auth at the bottom is the section which describe to enable external users to create tokens. But the steps how to do the auth process is not so clear for us.
So maybe someone can explain us how to auth an user over the rest api.
Hello @Ilgmi,
Welcome, and congratulations on your first post to the forum!
I want to make sure I’m understanding correctly to ensure we’re assisting you the best way possible. Just to confirm, you are saying you can authenticate to the AWX UI via Keycloak but not the API?
Any additional details you can provide about what you are trying to achieve will better enable us to assist you. We want to be sure we understand what service you are referring to when you mention “web-app.”
Call a function on the Backend-Service. Here the Access Token from keycloak is given.
Use the Rest API to start a Job. Here we want to give the keycloak to AWX
AWX use the OIDC Generic settings to Auth the User
We added the Sozial Auth Map for Organisation and Team, so that the user is in the correct organization and team.
We also enabled the option “Allow external Users to Create OAuth2 Tokens”.
We also know that there is an option to create OAuth2 tokens but we don’t realy know how to do that. Also the documentation of Authentication_o_list could help us.
Hello @Ilgmi,
Thank you so much for taking the time to sketch this out for us! We need to take a bit of time on our end to review this and understand what is happening here.
We did see you mention:
We also know that there is an option to create OAuth2 tokens but we don’t realy know how to do that. Also the documentation of Authentication_o_list could help us.
Please let us know if this documentation is helpful! We will spend more time with the other information you provided and try to get you some assistance there.