Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The Authorization header is missing

I am getting this error :{"error":{"code":"AuthenticationFailed","message":"Authentication failed. The 'Authorization' header is missing."}} whenever I am trying to test my API that is

https://management.azure.com/subscriptions/{subscriptionID}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus?api-version=2019-03-01

Can anybody suggest a solution how to set authentication header in postman or API Tester.

like image 690
shristi Avatar asked Jan 03 '20 10:01

shristi


People also ask

What is Authorization header in REST API?

The HTTP Authorization request header can be used to provide credentials that authenticate a user agent with a server, allowing access to a protected resource. The Authorization header is usually, but not always, sent after the user agent first attempts to request a protected resource without credentials.


2 Answers

Authorization is the part of HTTP Header and generally it is token which is Base64 encoded. In Postman, you can add it by clicking on "Headers" button.

This is where Authorization is set in Postman

like image 56
Indar Avatar answered Sep 22 '22 02:09

Indar


You need to set up and configure Postman to obtain an Azure Active Directory token.

A full walk though is covered here - screen shots below for quick reference.

Getting a token using Postman

From the docs - a sample token request form.

Token request form

like image 44
Murray Foxcroft Avatar answered Sep 24 '22 02:09

Murray Foxcroft