Why I Cannot Generate Oauth Tokens via API For Social or SAML Authenticated Users in Ansible Tower ?

Solution Verified - Updated -

Issue

When generating a Oauth Token for the Social or SAML Authenticated user by specifying the user's username and password in the API call, I'm getting "Authenticated credentials were not provided" error.

curl -ku USERNAME:PASSWORD -H "Content-Type: application/json" -X POST -d '{"description":"Tower CLI", "application":null, "scope":"write"}' https://tower.example.com/api/v2/users/18/personal_tokens/ |python -m json.tool

{
    "detail": "Authentication credentials were not provided. To establish a login session, visit /api/login/."
}

Environment

Ansible Tower 3.3+

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content