• 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:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

JAAS + JBOSS 5.1 - getting exception while trying perform authentication

 
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello friends,

This is first time I am implementing JAAS mechanism in my EJB3.0 + Jboss 5.1.0 applicaiton.
I really appreciate if anybody can guide me to resolve following exception which am getting while performing authentication through standalone Java application.



Please find following client and server side configured xml and Java code.

CLIENT SIDE CONFIGURATION

sample_jaas.config




LoginCallBackHandler.java



TestEJBWithSecurity.java "The test code"




SERVER SIDE CONFIGURATION

%JBOSS_HOME%\server\default\conf\login-config.xml



Note: One strange thing I have noticed it that I am not seeing java:/jaas/SampleAuth anywhere in JBoss Console log

Please help me where the problem is.

Gone through several resources over the net but not finding solution to this issue.

Thanks & Regards
Bhavesh
 
Bhavesh Dak
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't understand why it requires transaction while executing select queries on database.
It seems I have to give up on this, no progress since last 3 days
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you sure you want to use the DataBaseServerLoginModule on the client side (and not on server side)? That login module requires not just the transaction manager but also the datasource to be accessible on the client side.
 
Bhavesh Dak
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Jai for response,

Are you sure you want to use the DataBaseServerLoginModule on the client side (and not on server side)?



If I do not use this module then what should be the best practice for client side security implementation. My application is going to be a standalone swing application.

That login module requires not just the transaction manager but also the datasource to be accessible on the client side



I have given data source information in config file as below


I have read somewhere that transaction manager is not allowed to be used outside the container then how would I achieve this?
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Perhaps you could write your own login module which doesn't require transaction manager and simply uses JDBC to do the authentication. By the way, you do know that the client side usually passes on the login info (username, password) to the server side (using ClientLoginModule) and doesn't do the real authentication, right? The server is then setup to do the authentication (maybe using DataBaseServerLoginModule for example) and authorization. That way, you don't really need the DataBaseServerLoginModule on the client side. This and this might be of some help.
 
Bhavesh Dak
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Before your last post I just got your point of using ClientLoginModule which is enough as far as actual authentication happens at server side where I have used DataBaseServerLoginModule.

I am just done with implementation with ClientLoginModule and changed configuration file with just following,



Now everything (authorization and authentication) is working smoothly with my EJB 3.0 modules.

You really rock Jai, Thanks for your help and Happy Independence day in advance .



 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Wish you the same!
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic