• Post Reply Bookmark Topic Watch Topic
  • New Topic

JAAS: extend DatabasesServerLoginModule with more parameters

 
daniele licitra
Ranch Hand
Posts: 81
Java Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi to all.

I need to pass to the database login module another parameter, example
j_username = "john"
j_password = "secret"
j_enterprise = "John Ltd"

and to use it in my principalQuery to check the proper user regarding the enterprise where it work.

How can I do it?
 
daniele licitra
Ranch Hand
Posts: 81
Java Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Partially solved.


1) extend DatabaseServerLoginModule
2) override getUsernamesPassword

inside the method i use

to obtain the parameter map and all the value i need

Problem: this methid work only on first login!
Suppose I sign in with "UserA" and "PassA", then i logout (a servet do invalidatesession and request.logout())
The second time,
- if i sign in with "UserA" and "DifferentValue", the the method is called;
- if i sign in with the same credentials, no method are called!
Why ?
 
daniele licitra
Ranch Hand
Posts: 81
Java Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
for reference, i post some code:



 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!