• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

EJB Security Access

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I deployed my ejb in Weblogic 8.1. In my client, i am having the username/role, the welogic server has to check for the username/role and then allow to access that EJB. I got struck here, please help me by giving sample code or some tips...


ejb-jar.xml

<!DOCTYPE ejb-jar PUBLIC
"-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
"http://java.sun.com/dtd/ejb-jar_2_0.dtd">;

<ejb-jar>
<enterprise-beans>
<session>
<ejb-name>SIApp</ejb-name>
<home>com.lawson.ejb.SIHome</home>
<remote>com.lawson.ejb.SI</remote>
<ejb-class>com.lawson.ejb.SIBean</ejb-class>
<session-type>Stateful</session-type>
<transaction-type>Bean</transaction-type>
</session>
</enterprise-beans>
<assembly-descriptor>
<security-role>
<role-name>testrole</role-name>
</security-role>
<method-permission>
<role-name>testrole</role-name>
<method>
<ejb-name>SIApp</ejb-name>
<method-name>*</method-name>
</method>
</method-permission>
</assembly-descriptor>
</ejb-jar>


weblogic-ejb-jar.xml

<?xml version="1.0"?>

<!DOCTYPE weblogic-ejb-jar PUBLIC
'-//BEA Systems, Inc.//DTD WebLogic 8.1.0 EJB//EN'
'http://www.bea.com/servers/wls810/dtd/weblogic-ejb-jar.dtd'>


<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>SIApp</ejb-name>
<jndi-name>SimpleInterest</jndi-name>
</weblogic-enterprise-bean>
<security-role-assignment>
<role-name>testrole</role-name>
<principal-name>everyone</principal-name>
</security-role-assignment>
</weblogic-ejb-jar>


How can I use these in my Client....?


Thanks and regards
Mohan.G
 
Ranch Hand
Posts: 977
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm not sure about what exactly is your doubt but if you want the client code to pass the principal to the ejb layer you should use something like this when recovering the context:


regards,
 
A wop bop a lu bob a womp bam boom. Tutti frutti ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic