JDBC Realm Login Page

戏子无情 提交于 2019-11-28 13:01:12

If you followed the tutorial, Glassfish expects to find MD5 hashes of the passwords in usertable. But you inserted 1234. You will either have to insert the MD5 hash of 1234 which is: 81dc9bdb52d04dc20036dbd8313ed055 or you could tell Glassfish to use plain passwords, but I don't know what to put in the Digest then.

HTH

EDIT

In the tutorial the realm name is security but in your web.xml it is named Login

EDIT 2

There is even more wrong: To use the automatic login mechanism of Glassfish the form in your Login.jsp should have action="j_security_check" and the names for user and password should be j_username and j_password respectively.

Also see Matt Handy's answer and comment and provide some more details (such as error message or so). Otherwise it's very difficult to help if you just say "It doesn't work"

Configuring jdbc realm is a bit tricky. You gave a lot information in your question, but you missed to describe the error behavior.

Some ideas:

You have a group table, but does it contain the line (peterwkc, User)?

Did you store the hash of your password?

How does your JDBC realm configuration look like?

If you set the logging of the security module to finest, what's in server.log?

Kounavi

Check this out as I've analytically answered your question (minor mistakes may be inside):
JDBC Realm Form Authentication How To

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