16

How Do I Get By The Basic Authentication Handshake When Using Fiddler To Test A WCF REST Service?

ThinkingStiff
  • 64,767
  • 30
  • 146
  • 239
Peter
  • 5,251
  • 16
  • 63
  • 98
  • This is what worked for me! http://stackoverflow.com/questions/12501701/use-fiddler-with-basic-authentication-to-access-restful-webapi/12502718#12502718 – brianhevans Sep 19 '12 at 21:24

1 Answers1

28

You need to base64 encode your username:password and then prefix it with Basic. It will end up looking something like:

Authorization: Basic VEFWSVNcZGFycmVsOg==

You then enter this in the request headers field.

Darrel Miller
  • 139,164
  • 32
  • 194
  • 243
  • Darrel, what format should the text file that I am encoding be in? It looks like when it gets decoded on the server I am getting ????username@domain.com. I am guessing these are spaces but I don't have any leading spaces in my file. – Peter Feb 10 '11 at 14:46
  • @Code Sherpa What textfile? In the RequestBuilder tab in fiddler, there is a Request Headers textbox. Just paste your authorization header in there. – Darrel Miller Feb 10 '11 at 15:04
  • Yes, but the username:password needs to be encoded into a base64 string first... I have a utility that takes a file and outputs the contents to base 64 but am getting leading ????. – Peter Feb 10 '11 at 15:11
  • 5
    OK, the Fiddler Text Encode/Decode utility worked... I forgot about this. Thanks for your help – Peter Feb 10 '11 at 15:17
  • 1
    @Code Sherpa I had no idea about that Fiddler utility :-) Now I do! – Darrel Miller Feb 10 '11 at 15:28
  • 4
    For the record, this handy utility (which I also just discovered) is in `Tools -> Text Encode/Decode...`. – ladenedge Jul 12 '11 at 01:51
  • 1
    In Fiddler 4.4.2.1 (beta) it's in `Tools -> Text Wizard`. :) – Leniel Maccaferri Nov 27 '12 at 01:58