How to generate AWX Oauth2 token via API for social authenticated user

Hi everyone,

How can I generate a Oauth2 token via API for users authenticated with SAML or OIDC

Thanks.

Hi Ahmed,

For security reasons, we default to not allowing external users to create OAuth2 tokens. However, that can be enabled. Quote from the docs below:

The Allow External Users to Create Oauth2 Tokens (ALLOW_OAUTH2_FOR_EXTERNAL_USERS in the API) setting is disabled by default. External users refer to users authenticated externally with a service like LDAP, or any of the other SSO services. This setting ensures external users cannot create their own tokens. If you enable then disable it, any tokens created by external users in the meantime will still exist, and are not automatically revoked.

Hopefully this helps,
AWX Team

This was the doc like for that:

Also, it is possible to create an oauth2 token from the command-line, here are the docs for that:

Thanks,
AWX Team