- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to get OAuth Token- using Curl command
Hi, I want to get back Token id from the Curl command below :
curl -k -u UserName:Password -X POST https://0.0.0.0:8089/services/authorization/tokens
But , I am getting back :
<?xml version="1.0" encoding="UTF-8"?>
<response>
<messages>
<msg type="ERROR">Unauthorized</msg>
</messages>
</response>
Can anyone help how to resolve this case , what is missing in Curl command or what is wrong ?
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok, then You should double check that You are using correct username:password combination and that the user has Admin role
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well, I think that was related to the policy from Admin that not to use userName and Password and to use the token instead.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, use GET instead of POST
curl -k -u <username>:<password> -X GET https://<server>:<management_port>/services/authorization/tokens
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for your reply , but I still having same :
└──> curl -k -u UserName:PassWord -X GET https://0.0.0.0:8089/services/authorization/tokens
<?xml version="1.0" encoding="UTF-8"?>
<response>
<messages>
<msg type="ERROR">Unauthorized</msg>
</messages>
</response>
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok, then You should double check that You are using correct username:password combination and that the user has Admin role
