简体   繁体   English

HTTP状态403-禁止-使用glassfish-v3的jdbc领域设置

[英]HTTP Status 403 - Forbidden - jdbc realm setup with glassfish-v3

Hi guys i am just experimenting with some security features using glassfish, such as to block off access to a webpage to everyone apart from an authorized user, the main point of this exercise is just to get an understanding of how this can work 嗨,大家好,我只是在使用Glassfish尝试一些安全功能,例如阻止除授权用户以外的所有人访问网页,此练习的主要目的只是为了了解它的工作方式

i have followed the following tutorial to set up my glassfish server and also the web.xml file etc 我遵循以下教程来设置我的glassfish服务器以及web.xml文件等

http://blog.gamatam.com/2009/11/jdbc-realm-setup-with-glassfish-v3.html http://blog.gamatam.com/2009/11/jdbc-realm-setup-with-glassfish-v3.html

while i have set this up as per the settings i have noticed one weird issue 虽然我已经按照设置进行了设置,但我注意到一个奇怪的问题

when trying to get access to the /test/newxhtml.xhtml i get the correct username / password prompt but when i enter the user and password of admin i am greeted with the 403 page forbidden, however i have noticed that if i type the username / password wrong it re prompts me for the username and password 尝试访问/test/newxhtml.xhtml我得到正确的用户名/密码提示,但是当我输入admin的用户名和密码时,我被禁止使用403页,但是我注意到,如果我输入用户名/密码错误,它将重新提示我输入用户名和密码

basically i am wondering if this sounds right and instead of a 403 error can i display the webpage, and display the 403 if the user enters the wrong username and password 基本上我想知道这听起来是否正确,我可以显示网页,而不是403错误,如果用户输入了错误的用户名和密码,则可以显示403

thanks guys 多谢你们

EDIT 编辑

i have noticed in the console i get the error : 我在控制台中注意到我收到了错误消息:

WARNING:   No Principals mapped to Role [ADMIN].
WARNING:   No Principals mapped to Role [USER].

我已经弄清楚了,是的,没有配置任何映射,在glassfish-web.xml中添加了正确的映射,现在它可以工作了:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM