Enable adding values to Sphinx Headers

It would be useful to be able to pass some additional data when logging in via TSphinxWebLogin, so having an OnRequest event (as is available in TXDataWebConnection would be a great addition.

I don't think that's possible, since the login is performed by simply asking the browser to redirect to the URL of login app in Sphinx. It's the browser that performs the request.

I understand.

what about adding to the querystring? I guess I could do that when setting the authentication URI?

You should be able to add query string to the AuthorizationURL endpoint and it's preserved, according to OAuth 2 specification.

But TSphnxWebLogin retrieves the AuthorizationURL automatically from the server and doesn't provide such opportunity for you.

I wonder what is the use case for your request, so we can better think if and where to provide such flexibility.

The particular system doesn't require the user to log in for access, but they do get a session id. This is then provided in the header to all requests. We log quite a lot of the process and would like to attach the session id to the sphinx process logs that we create.

But if the request is going to a separate Sphinx server, what is the relevance that such API receives the session id, what would be done with it? Strange, especially that Sphinx is being used for login, where is the session id coming from then?

This is using a single application to manage sphinx and the application. When a user launches the site a call is made to a service to get a session id.