Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using membership in an ashx

Status
Not open for further replies.

0ddball

Technical User
Nov 6, 2003
208
GB
Good evening folks - I'm burning the midnight oil here so I may or may not be understandable - please try ;)

I'm building a web handler to handle a callback from a AJAX application. I can't seem to get any information about wether the person who has fired the callback is authenticated or not. The identity associated with the request is the Generic identity and not the forms authenticated one.

I'm going slowly insane and I don't seem to be able to find a solution to either my membershpi problem or the little blue pixies which are *constantly* fluttering around just behind me... they think I can't see - they know nothing! Mu hahahah.

Erm. So.

I need to know if it's possible to access the credentials of the client which fired an AJAX request. Is there some way to attatch the ASP.net session cookie to the AJAX request? Am I going to have to find some weird and wonderful way of authenticateing my users - such as RBPPC (Remote Blue Pixie Passport Check) - or is there an answer :)


Yet another unchecked rambling brought to you by:
Oddball
 
I'm going to bump this thread instead of posting again - save server resources and all that.

Does the lack of an answer mean that it isn't possible?


Yet another unchecked rambling brought to you by:
Oddball
 
Well, in theory an Xml HttpRequest used by the javascript in Ajax is just a regular HttpRequest. The server doesn't know or care if it's coming from Ajax or a standard browser GET or POST. What you need is the Authentication Ticket to get the username. That ticket is stored in a cookie on the client, and sent in the Header of each Http Request. So (in theory) that header and cookie should be present in an Ajax call. So it seems to me, that if you can get a reference to the current request you'll be able to get the user.

[blue]_______________________________________[/blue]
Business Logic:"AND when tweetle beetles battle with paddles in a puddle, they call it a tweetle beetle puddle paddle battle AND..." - Dr. Suess
 
Ok - so I've inspected the cookie collection in the request and the d.. darned thing is there... I just can't seem to work out how to get the thing to work out if the user is authenticated or not.

Can someone lay it out for me - I've got a caffine fluff-head at the moment :S


Yet another unchecked rambling brought to you by:
Oddball
 
Okey dokey - a situation update.

This seems to work in IE7, havn't tried 6 because I don't have it installed anymore - oops.

It doesn't, however, work in Firefox. In FF, the auth cookie isn't in the collection. I don't know where it is, or how firefox authenticates without it...

A bug in the FF XmlHTTPRequest object?


Yet another unchecked rambling brought to you by:
Oddball
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top