This is a mirror of official site: http://jasper-net.blogspot.com/

Automatic Authentication with the Request Builder

| Monday, August 16, 2010
The Request Builder feature in recent versions of Fiddler includes a number of enhancements, including the ability to follow HTTP redirections, and to automatically authenticate (using the current user's credentials) to servers that demand authentication using the NTLM or Negotiate (NTLM/Negotiate) challenge-response protocols. Following redirections is simple enough, but properly constructing a response to a server's Negotiate authentication request entails some very complicated code. The problem is that while .NET can automatically add credentials to HTTPWebRequest objects, there's no trivial way to calculate the challenge-response string when you're using a socket directly (as Fiddler does).

Fortunately, a (now-defunct) blog post from "Jeff" suggested a hack that works rather well—use Reflection to grab internal fields (including the challenge-response string) from a dummy WebRequest object. While using Reflection to grab internal fields is inherently fragile (e.g. subject to breakage in updated versions of the framework) this particular trick appears to work reliably in both .NETv2 and .NETv4 frameworks.

Each Fiddler session keeps a dummy WebRequest variable which is not initialized by default.

private WebRequest __WebRequestForAuth = null;
If, however, the server returns a WWW-Authenticate header demanding NTLM or Negotiate, and the Session Flag x-Builder-AutoAuth is present on the session, then the object will be initialized, with the current session's URL:

if (null == __WebRequestForAuth)
{  

__WebRequestForAuth = HttpWebRequest.Create(this.fullUrl);
}

Then, we use Reflection to get the Authorization String we'll be adding to the request

try                
{                    

#region Use-Reflection-Magic-To-Tweak-Internals                    
Type tWebReq = __WebRequestForAuth.GetType();
tWebReq.InvokeMember("Async", BindingFlags.Default | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.SetProperty, null, __WebRequestForAuth, new object[] { false });

object objServerAuthState = tWebReq.InvokeMember("ServerAuthenticationState", BindingFlags.Default | BindingFlags.NonPublic |
BindingFlags.Instance | BindingFlags.GetProperty, null, __WebRequestForAuth, new object[0]);                    
   
if (objServerAuthState == null) throw new ApplicationException("Auth state is null");

Type tAuthState = objServerAuthState.GetType();
tAuthState.InvokeMember("ChallengedUri", BindingFlags.Default | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.SetField, null, objServerAuthState, new object[] { new Uri(this.fullUrl)});                    

Posted via email from .NET Info

92 comments:

Anonymous said...

Have you ever considered writing an e-book or guest authoring on other websites?
I have a blog based upon on the same subjects you discuss
and would really like to have you share some stories/information.
I know my viewers would appreciate your work. If you are even remotely interested, feel free to send me an e mail.



My homepage: free xbox live

Anonymous said...

Keep this going please, great job!

Visit my homepage: free xbox live membership.get xbox live codes free

Anonymous said...

Free of charge cams of amateur exhibitionists.
Models, exhibitionists and professional live cam girls are flooding into share erotic and extremely sexy moments on Chaturbate.
I'll probably never become accustomed to chatting, in my work room, with someone twelve thousand miles away in Indonesia.

Also visit my web page; Http://Www.Adultstreamtube.Com

Anonymous said...

Date scamming refers to scammers who use fake profiles on (mostly) free dating sites to make
contact with other members. You may feel that it is not easy to get over your ex but
these sites help you get close and intimate with the other persons before you meet them
even if it's just for fun or for more. If giving orders is what turns you on, ask the camgirl if she would be comfortable doing it.

Feel free to visit my weblog; free sex chat

Anonymous said...

Pretty nice post. I just stumbled upon your weblog and wished to say that I have truly enjoyed
surfing around your blog posts. After all I'll be subscribing to your feed and I hope you write again soon!
See this: kliknij, http://pix.ie/kaczkapraczka

Anonymous said...

Pretty component to content. I just stumbled upon your blog and in accession capital to say
that I get actually enjoyed account your weblog posts.
Any way I will be subscribing for your feeds or even I success you access persistently quickly.


my web site ... chapter 13 bankruptcy florida

Anonymous said...

May I simply say what a comfort to discover
somebody who actually understands what they are talking about on the internet.

You definitely understand how to bring an issue to light and make it
important. More and more people must check this out and understand this side of the
story. I was surprised that you're not more popular given that you certainly have the gift.

Also visit my web site; bmi calculator for females

Anonymous said...

This web site definitely has all of the information I wanted
concerning this subject and didn't know who to ask.

Here is my weblog: just click the up coming web site

Anonymous said...

I have read so many posts on the topic of the blogger lovers however this article is
actually a pleasant article, keep it up.

Also visit my blog; Learn More

Anonymous said...

I always emailed this weblog post page to all my friends, since if like to read
it next my links will too.

Also visit my web blog see more

Anonymous said...

Peculiar article, exactly what I was looking for.

Also visit my blog: Homepage

Anonymous said...

Hi there! This is kind of off topic but I need some advice from an established
blog. Is it tough to set up your own blog? I'm not very techincal but I can figure things out pretty fast. I'm thinking about making my own but
I'm not sure where to begin. Do you have any ideas or suggestions? Cheers

Here is my weblog ... a nude model

Anonymous said...

Awesome blog! Is your theme custom made or did you download it from somewhere?
A design like yours with a few simple adjustements would really make my blog
jump out. Please let me know where you got your design.

Appreciate it

My blog post; www.lijit.com

Anonymous said...

Hey there, You have done a fantastic job. I will definitely digg it and personally recommend to my friends.

I am confident they'll be benefited from this site.

my web site live iphone cams

Anonymous said...

Hello, Neat post. There's an issue together with your site in web explorer, might test this? IE still is the marketplace leader and a huge component of folks will leave out your magnificent writing due to this problem.

Check out my webpage - free live sex for free

Anonymous said...

You actually make it appear so easy together with your presentation however I
find this matter to be actually one thing that I feel I'd by no means understand. It seems too complex and extremely wide for me. I'm looking
forward to your subsequent put up, I will attempt to
get the dangle of it!

Feel free to visit my web-site; live cams

Anonymous said...

I know this site presents quality dependent posts and other material, is there any other website
which presents these things in quality?

my blog :: live cams chats

Anonymous said...

This design is incredible! You certainly know how to keep
a reader entertained. Between your wit and your videos, I was almost moved
to start my own blog (well, almost...HaHa!
) Excellent job. I really enjoyed what you had to say, and more than that, how you presented it.
Too cool!

Here is my webpage :: http://www.restoredinc.com/

Anonymous said...

Keep on writing, great job!

my web-site live cams adult

Anonymous said...

Cool blog! Is your theme custom made or did you download it from somewhere?
A design like yours with a few simple tweeks would really
make my blog shine. Please let me know where you got your design.
Appreciate it

Check out my web-site :: arpacbueliamcmuibllin.polyvore.com

Anonymous said...

I couldn't resist commenting. Perfectly written!

Here is my homepage: aqanautica.com

Anonymous said...

Asking questions are genuinely nice thing if you are not understanding something entirely,
but this article offers pleasant understanding yet.


My weblog; http://pornharvest.com/index.php?m=2339695

Anonymous said...

I blog quite often and I seriously appreciate your content.
The article has really peaked my interest. I will book mark
your site and keep checking for new details about once a week.
I subscribed to your Feed too.

Here is my webpage: I was reading this

Anonymous said...

Excellent post. I used to be checking constantly this blog and I'm impressed! Extremely useful info particularly the remaining part :) I maintain such information much. I used to be looking for this particular information for a very long time. Thanks and best of luck.

Feel free to visit my page ... sex chat with cam

Anonymous said...

This article will help the internet visitors for creating new webpage or even a weblog
from start to end.

Look into my web page :: free online Porn Chat rooms

Anonymous said...

I every time spent my half an hour to read this weblog's articles or reviews everyday along with a cup of coffee.

Feel free to surf to my web page: http://www.georgiagolfcenter.com

Anonymous said...

My coder is trying to convince me to move to .
net from PHP. I have always disliked the idea because of the expenses.

But he's tryiong none the less. I've been using Movable-type on
several websites for about a year and am anxious
about switching to another platform. I have heard excellent things about
blogengine.net. Is there a way I can import all my wordpress
posts into it? Any help would be really appreciated!


Look at my webpage ... wellnesshealthcenters.com

Anonymous said...

Hi there! I know this is kinda off topic but I was wondering which blog platform are
you using for this site? I'm getting fed up of Wordpress because I've had problems
with hackers and I'm looking at alternatives for another platform. I would be awesome if you could point me in the direction of a good platform.

My weblog Louis Vuitton Bags

Anonymous said...

You actually make it seem so easy with your presentation but I find this topic to be actually something that I
think I would never understand. It seems too complicated and extremely broad
for me. I am looking forward for your next post, I will try
to get the hang of it!

my weblog ... live sex list

Anonymous said...

I couldn't resist commenting. Exceptionally well written!

my webpage; see more

Anonymous said...

Hmm it seems like your blog ate my first comment (it was super long) so I guess I'll just sum it up what I submitted and say, I'm thoroughly enjoying your blog.
I as well am an aspiring blog blogger but I'm still new to everything. Do you have any recommendations for first-time blog writers? I'd really appreciate it.


my homepage - free live sex cam videos

Anonymous said...

I just like the valuable information you provide for your articles.
I'll bookmark your weblog and take a look at again right here frequently. I'm moderately certain I will
be informed many new stuff right here! Good luck for the following!



my weblog; cams

Anonymous said...

If some one needs expert view concerning running a blog afterward i advise him/her to pay a quick visit this blog, Keep up the pleasant work.


Feel free to surf to my website; www.thisnext.com

Anonymous said...

Thank you, I've recently been searching for info approximately this subject for a while and yours is the best I've discovered till now.

But, what about the conclusion? Are you positive
about the source?

My web blog - sex chat adults

Anonymous said...

Hi would you mind letting me know which hosting company you're working with? I've loaded your blog in
3 completely different internet browsers and I must
say this blog loads a lot faster then most.
Can you recommend a good internet hosting provider at a fair price?
Thank you, I appreciate it!

Visit my web site ensynefo.com

Anonymous said...

I'd like to thank you for the efforts you have put in writing this site. I am hoping to view the same high-grade content from you in the future as well. In fact, your creative writing abilities has inspired me to get my very own blog now ;)

my page - www.106racepark.com

Anonymous said...

Very soon this web page will be famous among all blogging visitors,
due to it's fastidious articles or reviews

my weblog: randki w sieci

Anonymous said...

Hello to every single one, it's really a pleasant for me to go to see this website, it includes priceless Information.

my web site :: http://erotyczneoferty.waw.pl

Anonymous said...

Nice post. I was checking constantly this weblog and I'm impressed! Very helpful info specially the final part :) I care for such information much. I used to be looking for this certain info for a long time. Thank you and good luck.

Feel free to visit my webpage :: http://ogloszenia-prywatne.org.pl

Anonymous said...

Hi, I think your site might be having browser compatibility issues.
When I look at your website in Ie, it looks
fine but when opening in Internet Explorer, it has some overlapping.
I just wanted to give you a quick heads up! Other then that, amazing blog!


my web site: mój portal - sexoferty.biz.pl

Anonymous said...

Hello to every body, it's my first pay a quick visit of this website; this blog contains amazing and truly fine data for readers.

Feel free to surf to my web-site wellnesshealthcenters.com

Anonymous said...

Right now it sounds like Expression Engine is the preferred blogging platform available
right now. (from what I've read) Is that what you are using on your blog?

My web blog ... online live sex chats

Anonymous said...

You have made some decent points there. I checked on
the web for more information about the issue and found most people will go along with your views on this site.



Feel free to surf to my page; the porn tube

Anonymous said...

What's up Dear, are you genuinely visiting this site regularly, if so afterward you will absolutely get pleasant know-how.

my blog :: http://ndtechs.com/modules.php?name=Your_Account&op=userinfo&username=NorrisNew

Anonymous said...

This is my first time go to see at here and i am actually happy to read everthing at single
place.

My homepage: Read This

Anonymous said...

Excellent blog here! Also your web site loads
up very fast! What host are you using? Can I get your affiliate link to your
host? I wish my web site loaded up as quickly as yours lol

Here is my site: the sex videos

Anonymous said...

Great post.

my web site: sexchats

Anonymous said...

First of all I would like to say terrific blog!
I had a quick question which I'd like to ask if you don't mind.
I was interested to know how you center yourself and clear your head before writing.
I've had difficulty clearing my mind in getting my ideas out. I truly do take pleasure in writing however it just seems like the first 10 to 15 minutes are wasted just trying to figure out how to begin. Any suggestions or hints? Thank you!

Look at my homepage thesocials.info

Anonymous said...

Everyone loves it when folks come together and share ideas.
Great website, continue the good work!

Feel free to surf to my blog - free online sex Cams [jerewall.com]

Anonymous said...

My spouse and I stumbled over here by a different website and thought I might as well check
things out. I like what I see so now i am following you.
Look forward to going over your web page repeatedly.


Also visit my weblog ... click for source

Anonymous said...

Thanks in favor of sharing such a pleasant thinking, post is fastidious,
thats why i have read it entirely

My web page: free a porn video

Anonymous said...

I like it when individuals come together and share views.
Great blog, keep it up!

Here is my web blog; cam live chat

Anonymous said...

Amazing blog! Do you have any suggestions for aspiring writers?
I'm hoping to start my own website soon but I'm a little lost on
everything. Would you recommend starting with a free platform like Wordpress or
go for a paid option? There are so many choices out there that I'm completely overwhelmed .. Any suggestions? Thank you!

Here is my web page - live adult webcams (fowssocial.com)

Anonymous said...

Hi there! This blog post could not be written any
better! Looking through this post reminds me of my previous roommate!
He constantly kept talking about this. I'll send this post to him. Pretty sure he's going to have a great read.
Thank you for sharing!

Feel free to visit my page: adult free webcam chat ()

Anonymous said...

Sweet blog! I found it while surfing around on Yahoo News.
Do you have any tips on how to get listed in Yahoo News? I've been trying for a while but I never seem to get there! Thanks

Here is my webpage: porn chat cam ()

Anonymous said...

I could not resist commenting. Very well written!


Also visit my web page ... free cyber sex chat [startaidea.info]

Anonymous said...

Quality articles is the important to be a focus for the
viewers to go to see the web site, that's what this website is providing.

Take a look at my website :: Christian Louboutin Heels

Anonymous said...

Hello colleagues, its great paragraph about cultureand completely defined, keep it up all the time.


Also visit my webpage - sex chat hotline - -

Anonymous said...

Have you ever thought about adding a little bit more than just your articles?
I mean, what you say is valuable and everything.
However imagine if you added some great images or video clips
to give your posts more, "pop"! Your content is excellent but with
pics and clips, this site could certainly be one of the best in
its niche. Excellent blog!

my webpage :: Learn More

Anonymous said...

Hello are using Wordpress for your site platform?
I'm new to the blog world but I'm trying to get started and set up my own.
Do you require any html coding knowledge to make
your own blog? Any help would be greatly appreciated!


Have a look at my web page cam chats

Anonymous said...

Hi friends, its enormous article about educationand fully explained, keep it up all
the time.

Take a look at my webpage ... sex cams and chat (www.obland.net)

Anonymous said...

Hello, after reading this amazing piece of writing i am too glad to
share my familiarity here with mates.

My homepage :: cyber sex chat *http://elmomah.com/social/blogs/3438/6442/free-live-camera-porn-see-a-goo*

Anonymous said...

Piece of writing writing is also a excitement, if you know then you can write
if not it is difficult to write.

Visit my site - sex

Anonymous said...

I do believe all of the ideas you have introduced in your post.
They are very convincing and will certainly work.
Nonetheless, the posts are too short for beginners.
May just you please lengthen them a little from subsequent time?
Thanks for the post.

my web-site :: Free Sexy Cam Chat (Www.Groupfaces.Com)

Anonymous said...

Pretty! This was a really wonderful post. Thank you for providing these details.


my blog post ... sex

Anonymous said...

I've learn several good stuff here. Certainly worth bookmarking for revisiting. I wonder how a lot attempt you set to make one of these magnificent informative site.

My weblog ... mofos sex cams

Anonymous said...

Quality articles or reviews is the main to attract the users to pay a quick
visit the site, that's what this web page is providing.

Here is my site ... hot sex webcams

Anonymous said...

Keep this going please, great job!

Have a look at my weblog: porn chat site free

Anonymous said...

I'm really loving the theme/design of your blog. Do you ever run into any browser compatibility issues? A number of my blog audience have complained about my blog not working correctly in Explorer but looks great in Safari. Do you have any advice to help fix this problem?

Also visit my blog; web cam sexy - -

Anonymous said...

After exploring a number of the articles on your blog, I truly appreciate
your way of writing a blog. I book marked it to my bookmark website list and will
be checking back in the near future. Take a look at my web site as well and let me know how you feel.


my website Email Console

Anonymous said...

What's up everyone, it's my first visit at this site, and piece of writing is
in fact fruitful in support of me, keep up posting such
articles.

My website: sex

Anonymous said...

Your style is very unique in comparison to other folks I have read stuff from.
Thanks for posting when you have the opportunity, Guess I will just bookmark this page.



My page - cam sexy (8tracks.com)

Anonymous said...

Fastidious answers in return of this difficulty with firm arguments and describing the whole thing about that.


Also visit my web blog; free porn live chats ()

Anonymous said...

Woah! I'm really loving the template/theme of this website. It's simple, yet
effective. A lot of times it's difficult to get that "perfect balance" between user friendliness and visual appeal. I must say you have done a amazing job with this. In addition, the blog loads very fast for me on Chrome. Outstanding Blog!

Also visit my webpage; Sac A Main Louis Vuitton

Anonymous said...

Why people still make use of to read news papers when in this technological globe the
whole thing is presented on web?

Here is my web site ... naked free sex chat

Anonymous said...

Hey! I just wanted to ask if you ever have any problems with hackers?
My last blog (wordpress) was hacked and I ended
up losing a few months of hard work due to no back up. Do you have any solutions to stop hackers?


my web page: Sac a main Guess

Anonymous said...

You actually make it seem really easy with your presentation but
I in finding this matter to be really something which
I believe I might never understand. It seems too complex and
extremely large for me. I am having a look forward for your next put
up, I'll attempt to get the hang of it!

Also visit my site; Look At This

Anonymous said...

Nice blog here! Also your web site loads up very fast! What host are you using?
Can I get your affiliate link to your host? I wish my web site loaded
up as fast as yours lol

My webpage :: Nike Air Jordan

Anonymous said...

wonderful issues altogether, you simply received a brand new reader.
What may you suggest about your put up that you made some days ago?
Any positive?

Also visit my weblog - Cheap NFL Jerseys *overuc.com*

Anonymous said...

Excellent beat ! I wish to apprentice at the same
time as you amend your website, how can i subscribe for a weblog website?
The account aided me a applicable deal. I had been tiny bit familiar of this your broadcast provided vibrant
clear idea

Feel free to surf to my site cam porn

Anonymous said...

It's actually a nice and useful piece of information. I'm satisfied that you simply shared this helpful information with
us. Please stay us informed like this. Thanks for sharing.


Check out my page - Cheap Jerseys

Anonymous said...

With havin so much content and articles do you ever run into any problems of plagorism
or copyright infringement? My site has a lot of completely unique content I've either authored myself or outsourced but it appears a lot of it is popping it up all over the web without my agreement. Do you know any ways to help reduce content from being stolen? I'd genuinely appreciate it.


my website; Sac Louis Vuitton (nysacpr.org)

Anonymous said...

Hello, yeah this post is actually fastidious and I have learned lot of things from it concerning blogging.
thanks.

My web page Nusper Naked Male

Anonymous said...

For most recent information you have to go to see the web and on the web I found this web
site as a most excellent web site for newest updates.

Also visit my website sex

Anonymous said...

I every time used to read article in news papers but now as I am a user of
web thus from now I am using net for posts, thanks to
web.

Feel free to surf to my web page hot sex cams

Anonymous said...

Heya i am for the first time here. I found this board and I find It really useful & it helped
me out a lot. I hope to give something back and
aid others like you helped me.

Also visit my site: cam com chat :: ::

Anonymous said...

We're a group of volunteers and opening a new scheme in our community. Your website provided us with valuable information to work on. You have done a formidable job and our whole community will be grateful to you.

my website :: lives cam sex

Anonymous said...

Howdy would you mind sharing which blog platform you're using? I'm going to start
my own blog in the near future but I'm having a difficult time selecting between BlogEngine/Wordpress/B2evolution and Drupal. The reason I ask is because your design seems different then most blogs and I'm looking for something
completely unique. P.S My apologies for getting off-topic but
I had to ask!

Here is my page; Margo - hindisongs.us ()

Anonymous said...

Your phone is now unlocked. We all know that to answer the
phone while the phone is dangerous, however, have you
ever heard such a story. Image credits:.

Feel free to surf to my webpage :: telefony

Anonymous said...

Does your blog have a contact page? I'm having problems locating it but, I'd like to
shoot you an e-mail. I've got some creative ideas for your blog you might be interested in hearing. Either way, great website and I look forward to seeing it develop over time.

my web-site :: webcam chat adult **

Anonymous said...

I think everything typed was very logical.

However, think on this, suppose you wrote a catchier post title?
I mean, I don't want to tell you how to run your website, but what if you added a headline that makes people want more? I mean "Automatic Authentication with the Request Builder" is a little boring. You ought to glance at Yahoo's home page and
watch how they create article headlines to grab people to click.

You might add a related video or a related picture or two to get readers interested about what you've written. Just my opinion, it could bring your blog a little livelier.

My web page - live webcam sex show ()

Anonymous said...

This is a topic which is close to my heart... Best wishes!
Where are your contact details though?

Feel free to surf to my blog ... pc tools registry mechanic