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
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

How to servlet invoked secured EJB in JBOSS

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
I have Session EJBs and makes secure and provide the permission to each method. I am using UsersRoleLoginModule which jboss uses default. I included security domain in jboss.xml file.

<security-domain>java:/jaas/other</security-domain>



I am using standalone client which calls this ejb by passing username and password. For that I have done some changes in code with respect to JBOSS. Previously it was login in the Websphere. Below is the code for JBOSS´┐Ż



String securityDomain = "other";

//Customize the callback handler to set username and password for login.

CallbackHandler callbackHandler = new CustomCallbackHandler(username, password);



//Lookup the security domain and retrieve the LoginContect reference

LoginContext lc = new LoginContext( securityDomain, callbackHandler );

//Login to domain.

lc.login();



I checked my client it is working fine with this code and able to authenticate and Authorize my process.



After I made EJB secure in JBOSS then my web client is not able to communicate with EJB. I am trying to authenticate and authorize from WEB so the servlet is not able to invoke my secure EJB. I am getting below exception.
java.rmi.AccessException: SecurityException; nested exception is:
javax.security.auth.login.FailedLoginException: Password Incorrect/Password Required
at org.jboss.ejb.plugins.LogInterceptor.handleException(LogInterceptor.java:370)


I would be grateful for any suggestions.
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Please refrain from duplicate posting. You can always delete your own threads by clicking in the Edit button, then check the Delete checkbox.

I am closing this duplicate.

Mark
 
    Bookmark Topic Watch Topic
  • New Topic