3 Replies Latest reply on Feb 14, 2019 3:06 PM by Oleg Burakov

    WildFly 15, get password ejb-remote: "Remote EJB Client Example"

    Oleg Burakov Newbie

      Good day!

       

      There is a very large system built on JBoss 6. To log in to the user, the username and password to connect to the database I must take from the client side of the program.

      The username and password to log in are the same as the username and password in the database.

       

      I found in the examples how to get the username (ctx.getCallerPrincipal ()).

       

      Can you please tell me how to get a password in WildFly 15?

       

      An example was taken in "quickstart" - ejb-remote: "Remote EJB Client Example".

       

      Example get Principal:

          // Inject the Session Context
          @Resource
          private SessionContext ctx;
      .....
              Principal principal = ctx.getCallerPrincipal();
                      return principal.toString();
        • 1. Re: WildFly 15, get password ejb-remote: "Remote EJB Client Example"
          Oleg Burakov Newbie

          In JBoss 6 AS we used the configuration shown below.

          In WildFly 15 there is a mechanism that implements a configuration similar to JBoss 6 AS?

           

           

          Sorry my english.

          For earlier thanks for the answer.

           

          Configuration Jboss AS 6:

            <application-policy name = "IGRoles">
               <authentication>  
                    <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"  
                      flag = "required">  
                      <module-option name="usersProperties">IG_users.properties</module-option>  
                      <module-option name="rolesProperties">IG_roles.properties</module-option>  
                    </login-module>  
                </authentication>  
              </application-policy>  
          

           

              <application-policy name = "IG_CallerDS">  
                <authentication>  
                    <login-module code = "org.jboss.resource.security.CallerIdentityLoginModule"  
                      flag = "required">  
                      <module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=OraDSIG</module-option>  
                    </login-module>  
                </authentication>  
              </application-policy>  
          
          

           

          <datasources>  
            <local-tx-datasource>  
              <jndi-name>OraDSIG</jndi-name>  
          <connection-url>jdbc:oracle:thin:@localhost:1521:olg1</connection-url>  
          <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>  
          <security-domain>IG_CallerDS</security-domain>  
          <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>  
          </local-tx-datasource>  
          </datasources> 
          
          • 2. Re: WildFly 15, get password ejb-remote: "Remote EJB Client Example"
            Wolfgang Mayer Master

            This should still be possible in WildFly either via Security Domain (PicketBox security) or Authentication Context (Elytron)

            • 3. Re: WildFly 15, get password ejb-remote: "Remote EJB Client Example"
              Oleg Burakov Newbie

              Wolfgang perhaps you have an example for the Authentication Context (Elytron)?