Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-5359

Configuring a JAAS PropertyLoginModule using karaf.home system property fails on Windows

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • None
    • jboss-fuse-6.2.1
    • Karaf
    • None
    • % %
    • Hide

      1. create a testuser.properties file with following contents and copy it over to "<JBoss_Fuse_Home>/etc/" folder;

      testuser1=password,admin
      testuser2=password,viewer
      

      2. deploy above blueprint.xml file by copying it over to "<JBoss_Fuse_Home>/deploy/" folder.

      Show
      1. create a testuser.properties file with following contents and copy it over to "<JBoss_Fuse_Home>/etc/" folder; testuser1=password,admin testuser2=password,viewer 2. deploy above blueprint.xml file by copying it over to "<JBoss_Fuse_Home>/deploy/" folder.

    Description

      I have following blueprint.xml for creating a JAAS PropertyLoginModule:

      <?xml version="1.0" encoding="UTF-8"?>
      <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
              xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xmlns:jaas="http://karaf.apache.org/xmlns/jaas/v1.0.0"
              xsi:schemaLocation="
             http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
      
          <ext:property-placeholder placeholder-prefix="$[" placeholder-suffix="]"/>
      
          <jaas:config name="test" rank="1">
              <jaas:module className="org.apache.karaf.jaas.modules.properties.PropertiesLoginModule"
                           flags="required">
                  users = $[karaf.home]/etc/testuser.properties
              </jaas:module>
          </jaas:config>
      </blueprint>
      

      It works fine on Linux but not on Windows.

      It looks like that the problem was in Karaf PropertyLoginModule rather than blueprint extension namespace implementation. The $[karaf.hom] property placeholder returns correct value for me on Windows:

      C:\\jboss\\fuse\\6.2.1\\jboss-fuse-6.2.1.redhat-084
      

      However, when the org.apache.karaf.jaas.modules.properties.PropertiesLoginModule tries to read the file using the "usersFile" path, it tried to read on following value instead:
      C:\jboss\fuse\6.2.1\jboss-fuse-6.2.1.redhat-084/etc/testuser.properties
      Obviously it won't work on Windows.

      Attachments

        Activity

          People

            pantinor@redhat.com Paolo Antinori
            rhn-support-qluo Joe Luo
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: