admin管理员组文章数量:1287665
I am new to web development. I have Android application that hosts some web pages using HTTPServer. I am using Netty to decode/encode request/responses. Now, I want to display basic authentication dialog when someone navigates to the my webpage. Something like this:
Can I get some pointers ? Is it something HTTP built in functionality, any RFC ? Do I need to write some java script ? Any help would be great.
I am new to web development. I have Android application that hosts some web pages using HTTPServer. I am using Netty to decode/encode request/responses. Now, I want to display basic authentication dialog when someone navigates to the my webpage. Something like this:
Can I get some pointers ? Is it something HTTP built in functionality, any RFC ? Do I need to write some java script ? Any help would be great.
Share Improve this question asked Mar 2, 2013 at 17:27 Arjun PatelArjun Patel 3536 silver badges22 bronze badges1 Answer
Reset to default 10You just need to send the appropriate headers when a client requests a resource you want to require authentication for.
HTTP/1.1 401 Unauthorized
WWW-Authenticate: Basic realm="Restricted Area"
The client can then retry the request while sending a base64 encoded header in the format username:password
.
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
See also: http://en.wikipedia/wiki/Basic_access_authentication
本文标签: javascriptHow to display HTTP 401 basic authentication dialogStack Overflow
版权声明:本文标题:javascript - How to display HTTP 401 basic authentication dialog - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741315859a2371908.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论