• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

JDBCRealm and Form Login

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've been trying to get form-based login with jdbcRealm working, but I'm having a few problems.

Spent countless hours searching for an answer, but I can't find a solution.

First, I'll go through my configuration.

In the Glassfish Admin Console, I added a new realm under Configuration->Security->Realms:



The database connection is working, as I've been using it with the application before adding any login configuration.

I have the following table defined:





User contains: 'admin','76a2173be6393254e72ffa4d6df1030a'
Group contains: 'admin','Administrator'

The login page contains the following form:




Next, in web.xml:



And lastly, sun-web.xml:



Submitting my username/password on the login page results in a login failure, directing me to the login error page.



I found a blog post that suggested CHECKing " Default Principal To Role Mapping" under the Glassfish Security options:

http://gesker.blogspot.com/2007/03/jspwikiglassfish-install-part-11-of-18.html

In addition, I added the following to domain.xml (in order to get more detailed information):




The result was the following:



Any help would be appreciated.

[ January 14, 2008: Message edited by: Lars Zinkoff ]
[ January 14, 2008: Message edited by: Lars Zinkoff ]
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Zinkoff,

I also face exactly the same problem and exactly the same exception. I also have tried the login context , change to FINEST etc etc , but all of them doesn't work. Untill i found this forum and it seems that you have the same problems. btw, I use oracle for the database.

Someone tried to fill UTF-8 for the charset or change digest to "none" to use a clear text password but it doesn't work for me. See if it works in your code.

do you have already get the solution? Please help.



Guret
 
feri guretno
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Allright!! I've got the solution.

if you use a cleartext password , set digest to "none". If it still doesn't work, try to change column name "password" in usertable to other name e.g "pwd". Sometimes column password is reserved by the database itself that prevent the jdbc realm to work properly.

Guret
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How to configure Glassfish with jdbc realm?
(i got this Error : SEC5046: Audit: Authentication refused for [admin].)

if you know please give me reply [email protected]
 
reply
    Bookmark Topic Watch Topic
  • New Topic