Obtaining username from Apache Realm in Xojo WebApp

Has anyone managed to obtain the username from an Apache Realm login from within a Xojo WebApp. Apache Realms are the standard way of providing HTTP authentication using Apache the docs are here http://httpd.apache.org/docs/2.2/howto/auth.html

Typically, in PHP for example, the username would be presented as part of the HTTP headers. I’ve tried using HTTPHeader properties of the WebSession class and can’t find the information there. Has anyone solved this problem?

You’ll need to do this in HandleURL. The headers you specified in Session are HTML headers, not HTTP headers.

A couple of issues there:

  1. HandleURL is an App level event, not tied to a given session, how would you tie that to a given session.
  2. According to the docs HandleURL only occurs when the app would otherwise have returned a 404 error, so it wont occur for standard app access.

I suppose I could have a bogus URL that I use and then somehow start a session myself, assigning the username I found to the session object, I’m not sure that is a wise cause of action. as I expect it would upset your framwork

The other thought is that new connections could be started with a URL that is caught by HandleURL and then redirected to a stock URL with a URLParameter that holds the name.