customizing apache tomcat authentication Required popup - apache

i want to add a "register" link into the apache authentication popup.
i would also like to change the error message page that is called when you press cancel.
i looked into directory www/error where i found some files but it seem none of those files is the error page that is called.
how can i find the Authorization Required page that is called ?
so i can change it.

You can't - that's native browser behavior, not an Apache popup. Try different browsers and see how they do the popup differently.

Related

Catching HTTP errors before redirect via 51degrees (vb.net)

I am using 51degrees.mobi and it is working well but in the case of the mobile server experiencing issues (HTTP error status) I want to be able to allow the user to continue on with the desktop version of the mobile site. I know I can stop the redirect by commenting out the redirect section of the config but is it possible to stop the redirect pragmatically?
I am currently working for 51Degrees.mobi.
If I understand you correctly then what you are asking to do is not possible through 51Degrees as you cannot change the configuration rules.
However what you want to do may be possible by editing your web.config file so that it will send you to the normal page if an error code is thrown using a customErrors element? More information on doing that can be found here. It may also be possible to do by modifying your pages PreInit() event.
Hope this helps.

Modal Apache htaccess?

Apache realm auth is great for quick and dirty site acl's. Can one do realm authentication with a modal window instead of the usual ugly native one? I know there are other solutions, like CAS, etc. But Apache is always there (for the most part) and .htaccess is simple quick and easy
As a short answer no; the ugly native window is not something coming from Apache, but from your browser.
When you ask access to a resource, basically answers with a response with status 401 (Unauthorized); the browser shows the usual modal dialog, asking for username and password; once you provide them, the browser tries again adding an Authentication: header with the username/password provided. If you can be authorized, fine, otherwise you've another 401, and the browser asks for the password again.
Simple answer: no.
This "ugly native window" is the kind of dialog your web browser shows when it encounters HTTP authentication as defined in RFC 2617. This has nothing to do with Apache httpd, the dialog will look the same in your web browser, no matter which web server (Apache httpd, nginx, lighttpd, IIS, Hiawatha, fnord, gatling, …) generated the WWW-Authenticate header.

Prevent built-in prompts in xul

I have an application that loads a web page in the browser and saves it to custom local folder (images, html, css). In the process the "src" attribute of images (in html) and "background-url" property (in css) need to be changed to reflect the locally saved files rather than the original ones. This generates extra web traffic as changing them forces the browser to download the files from modified locations (the browser does this by resolving the uri of the page with the value of element's "src" attribute - the same for "background-url" property ) and as a result, it generates lots of 404 Not Found requests.
I'm using nsIIOService interface to go offline before saving the page (the page is fully loaded and all network activity so far has been stopped) and then back online after the saving is complete. But then the browser displays an alert box "This document cannot be displayed while offline. To go online, uncheck Work Offline from the File menu." whenever I try to change the aforementioned attributes/properties.
Is there any way to prevent such message from appearing or to make the browser not validate the images because of modified "src" values?
I tried to use DOMWillOpenModalDialog on both the browser and the xul application window, but it seems it's of no use - the dialog still appears. The application is not an user application, so it's difficult when such "built-in" messages appear.
Use preventDefault to stop the modal dialog:
document.getElementById(‘content’).contentWindow.addEventListener(‘DOMWillOpenModalDialog’,function(e){ e.preventDefault(); }, true);
As an alternative, try using disablePrivilege, sandbox, redefining the prompt service, or overriding window.alert.

http://dev.twitter.com/ redirects to http://twitter.com/

I am trying to access my Twitter API but the call is failing due to the redirect. Does anybody know why this is happening and or how I can fix it? Yes, I am signed in.
Are you using the "Use HTTPS" on Chrome, or a similar extension?
For me, it redirects http://dev.twitter.com to https://dev.twitter.com, which in turn redirects to https://twitter.com
Ideally, the extension would offer more control in how it matches domains. Meanwhile, a quick workaround is to open an incognito window, for which extensions are disabled, and view dev.twitter.com there.

Safari browser won't display Error 401 page

I'm using Apache 2 and have a custom 401 page, in httpd.conf
ErrorDocument 401 /error/unauthorized.html
When I access a protected resource, all browsers show the basic http authentication dialog. If I click "cancel", all browsers but Safari (v3 and v4) will display the custom 401 page. Safari just displays the current page.
Is there any way to get Safari to display the 401 page through Apache configuration and/or mod_perl handlers?
G'day,
I believe that this is a well known issue for Safari browsers. In fact, several aspects of HTTP Authentication are subject to a "special" Apple implementation.
Sorry I can't give you a quick workaround.
cheers,
I can't reproduce the error in Safari 4 Beta, but try adding some bytes in your unauthorized.html file. Some versions of IE wouldn't show custom error pages unless the page was over a certain size, it assumed small pages were the default non-useful pages and tried to show something more useful (aka confusing).