How can I get browser authentication popup?

↘锁芯ラ 提交于 2019-12-05 12:05:53

问题


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


回答1:


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"




回答2:


That type of window pops up when a web server responds to a request by returning an "Unauthorized" (401) status code. You'd have to tell the server to send that type of response in order to trigger the popup.




回答3:


The authentication you are talking is called Basic Authentication in web based application where browser popup will be used to get user credentials.

Which Java Application Server you are using ?

To know more about Basic Authentication look at this page



来源:https://stackoverflow.com/questions/23004942/how-can-i-get-browser-authentication-popup

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!