How can I get browser authentication popup?

saplingPro picture saplingPro · Apr 11, 2014 · Viewed 21.1k times · Source

Can anyone tell me, how can I get this browser authentication window ?

enter image description here

Answer

niklasfi picture niklasfi · Apr 11, 2014

This popup is part of the HTTP-Authentication. In order to get it, you need to enable it in your web server. As Wikipedia puts it:

When the server wants the user agent to authenticate itself towards the server, it can send a request for authentication.

This request should be sent using the HTTP 401 Not Authorized response code containing a WWW-Authenticate HTTP header.

The WWW-Authenticate header for basic authentication (used most often) is constructed as following: WWW-Authenticate: Basicrealm="insert realm"