Start a Conversation

Solved!

Go to Solution

1 Rookie

 • 

3 Posts

39

March 19th, 2024 09:10

Correct Authorization header for request

I got a successful response to the request to create an accessToken. I want to make another request for devices and I will add the Authorization header with the accessToken value to this request.
Unfortunately, SCG returns me the response "Authorization Header is wrong" with code SAE-080006.
What is the correct format for the Authorisation header?

Moderator

 • 

8.5K Posts

March 20th, 2024 19:15

I believe it is going to come down to syntax, as this query is working for me while testing. 

 

Get list of assets: 

curl -k -H 'Content-Type: application/json'  -H 'Authorization:Bearer <token>' https://IPADDRESS:5700/SupportAssist/api/v2/inventory/assets 

Could you try comparing to it and see if there is a difference?


Moderator

 • 

8.5K Posts

March 19th, 2024 14:39

Logart,

 

What I would expect would be Authorization: accesstoken, followed with the access token that you got from the first step that worked.

 

 

Let me know if this helps.

 

 

1 Rookie

 • 

3 Posts

March 20th, 2024 09:44

When I use format

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c1VyTmFtZSI6ImFkbWluIiwicm9sZSI6IlNDR0FkbWlucyIsInJlcXVlc3RpbmdJUCI6IjEwLjIuNjAuMSIsImFwcE1vZGUiOiJBUFBsSUFOQ0VTIiwiYXBpVXNhZ2VNb2RlIjoiUmVzdCIsImluc3RhbmNlSUQiOiJzeVNNQ0xqb0EvMDBFVGRITXhtbDZnVDUzrHFpeVg0ZGQyMVc4Q3ZCbTY2MVlxVGEyd2JYdkdvOHVsZHdkRk5mbXR4UXJnaTVLZVJHRkdnNTNMM3I3UT09IiwidG9rZW5UeXBlIjoiQUNDRVNTIiwidXVpZCI6Ijc3MzBjMTNkLThhNzAtNDI3YS05MWI0LWYwN2JiNjU3MWZhNyIsImlhdCI6MTcxMDkyNzYyMCwiZXhwIjoxNzEwOTI5NDIwfQ.X7FwgEEZRvU1sWvMwU5aQ2F7Yz5mK0heiY-6jdGmunE

I get error "Authorisation Header is wrong!" with code SAE-080006

What is the exact format of the header.

Authorization: Bearer <token> - is not working.

1 Rookie

 • 

15 Posts

March 20th, 2024 15:03

@logart If you are using the Python requests library, this is how you would update the headers after receiving the Bearer token to make subsequent requests to the API. 

session.headers.update({'Authorization': 'Bearer '+response.json()['accessToken']})

Did I answer your query? Please click on ‘Mark as Accepted Answer’. ‘Thumbs up’ the posts you like!

1 Rookie

 • 

3 Posts

March 21st, 2024 09:36

Thank you for your help. It's strange, but the program I used (Restdebugger) probably sends the wrong Authorization header. If I used curl, everything works.

No Events found!

Top