0 Replies Latest reply on May 18, 2005 6:43 AM by Mark van Winsen

    passing security information over JNDI to the resource adapt

    Mark van Winsen Newbie

      Hello,

      i'm trying to pass security information into the JNDI, but my Resource adapter doesn't do anything with this information. The subject stays empty when i'm using the getConnection() method without parameters.
      Does anyone knows a sollution to this problem?

      I've added the following code:



      Hashtable properties = new Hashtable();
      properties.put(Context.SECURITY_PRINCIPAL, userName);
      properties.put(Context.SECURITY_CREDENTIALS,userPassWord);
      Context jndiContext = new InitialContext(properties); // properties contians the
      Object ref = jndiContext.lookup("ejb/ResourceConnectorSession");



      <ejb-jar.xml>


      <![CDATA[Description for ResourceConnectorSession]]>
      <display-name>Name for ResourceConnectorSession</display-name>

      <ejb-name>ResourceConnectorSession</ejb-name>

      SsaJcaTestClient.interfaces.ResourceConnectorSessionHome
      SsaJcaTestClient.interfaces.ResourceConnectorSession
      <ejb-class>SsaJcaTestClient.ejb.ResourceConnectorSessionBean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container</transaction-type>

      <resource-ref>
      A J2ee Resource Adapter
      <res-ref-name>SsaJcaConnector</res-ref-name>
      <res-type>javax.resource.cci.ConnectionFactory</res-type>
      <res-auth>Container</res-auth>
      </resource-ref>




      <jboss.xml>



      <ejb-name>ResourceConnectorSession</ejb-name>
      <jndi-name>ejb/ResourceConnectorSession</jndi-name>
      <resource-ref>
      <res-ref-name>SsaJcaConnector</res-ref-name>
      <jndi-name>java:/SsaJcaConnector</jndi-name>

      </resource-ref>