Authentication



Hi,

I'm doing authentication in my libsoup based server.
When authentication fails, the server responds with status-code 401 Unauthorized.
That will cause the browser to open the login dialog box.
This is quite annoying in cases where I e.g. use XMLHttpRequest()

I would like to be able to change the status-code to e.g. 403 Forbidden, which will not make the browser open the login dialog box. And I'll be able to handle the situation in ECMAScript/javascript by e.g. redirecting to some general login-page.

I've digged into the source and it seems that the status-code is set to one of 401 Unauthorized or 407 Proxy Authentication Required based on proxy or not. And apparently can't be set to anything else through the API.

Are there any way I can change the status-code to 403, without having to make my complete own authentication mechanism (which I would of course like to avoid)?


Best regards
Egon Andersen


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]