AnsweredAssumed Answered

401 Unauthorised when using AUTH API

Question asked by Jordan Duffy on Nov 23, 2017
Latest reply on Nov 27, 2017 by Ben Isherwood

Hi All

 

I am trying to grab an auth token via the REST API and constantly get a 401 Unauthorised error regardless of if I am on the local machine or another client. Any ideas why this might be occurring?

 

Request:

curl -ik -X POST https://IPADDRESS:8000/auth/oauth/ \

-d grant_type=password \

-d username=admin \

-d password=APASSWORD \

-d scope=* \

-d client_secret=hci-client \

-d client_id=hci-client \

-d realm=Local

 

Response:

HTTP/1.1 401 Unauthorized

Access-Control-Allow-Origin: *

Access-Control-Allow-Methods: GET, POST, DELETE, PUT, HEAD, OPTIONS

Access-Control-Allow-Headers: Origin, Accept, Authorization, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers

Access-Control-Allow-Credentials: true

Access-Control-Max-Age: 1800

Set-Cookie: JwtCookie=deleteMe; Path=/; Max-Age=0; Expires=Thu, 23-Nov-2017 01:21:46 GMT; Secure

WWW-Authenticate: Bearer realm="application"

Content-Length: 0

Date: Fri, 24 Nov 2017 01:21:46 GMT

Server: HCI

Outcomes