0

How can I locally reproduce the https GET call that my Azure Scheduler job would execute that uses Basic Authentication with a username/password?

I know I can just type in the URL in the browser to hit the action in my MVC controller, but how does Azure Scheduler send the username/password?

user2713516
  • 2,983
  • 5
  • 23
  • 49

1 Answers1

2

If Azure Scheduler uses Basic Authentication then it will send the username and password as Base64 encoded Authorization header.

  1. The username and password are combined into a string separated by a colon, e.g.: username:password
  2. The resulting string is encoded using the RFC2045-MIME variant of Base64, except not limited to 76 char/line.
  3. The authorization method and a space i.e. "Basic " is then put before the encoded string.

So for example if your username=john and password=secret, the Authorization header would look like this:

Authorization: Basic am9objpzZWNyZXQ=

So you should make the following HTTP request:

GET /yourcontroller/youraction HTTP/1.1
Authorization: Basic am9objpzZWNyZXQ=
Connection: close
Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928