Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-6708

Replicating default PropertiesLoginModule configuration does not work on Windows

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 4.1.4
    • None
    • karaf
    • None
    • OS Name: Microsoft Windows 10 Enterprise
      Version: 10.0.18363 Build 18363

      java version "1.8.0_201"
      Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
      Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)

    Description

      Steps to Reproduce

      • Start Karaf 4.1.4 on Windows
      • Put custom-realm.xml in the hot deployment directory. This is more or less the minimal example for PropertiesLoginModule that is documented in the Manual
      • In the Karaf shell, use jaas:realm-manage --index 6 followed by jaas:user-list to obtain the list of users.
      • compare the output to the results for the default PropertiesLoginModule (use jaas:realm-manage --index 1 followed by jaas:user-list)

      Expected Behavior

      The outputs should match

      Actual Results

      The replicated PropertiesLoginModule configuration returns an empty listing. This seems to be the normal result, when the users-file is not found.

      I get this output:

      karaf@root()> env karaf.etc
      String          karaf.etc       C:\r1\t1\n1\2\apache-karaf-4.1.4\etc
      
      karaf@root()> jaas:realm-list
      Index | Realm Name | Login Module Class Name
      ------+------------+---------------------------------------------------------------
      1     | karaf      | org.apache.karaf.jaas.modules.properties.PropertiesLoginModule
      2     | karaf      | org.apache.karaf.jaas.modules.publickey.PublickeyLoginModule
      3     | karaf      | org.apache.karaf.jaas.modules.audit.FileAuditLoginModule
      4     | karaf      | org.apache.karaf.jaas.modules.audit.LogAuditLoginModule
      5     | karaf      | org.apache.karaf.jaas.modules.audit.EventAdminAuditLoginModule
      6     | my-realm   | org.apache.karaf.jaas.modules.properties.PropertiesLoginModule
      karaf@root()> jaas:realm-manage --index 6
      
      karaf@root()> jaas:user-list
      User Name | Group | Role
      ----------+-------+-----
      
      
      karaf@root()> jaas:realm-manage --index 1 --force
      
      karaf@root()> jaas:user-list
      User Name | Group      | Role
      ----------+------------+--------------
      karaf     | admingroup | admin
      karaf     | admingroup | manager
      karaf     | admingroup | viewer
      karaf     | admingroup | systembundles
      karaf     | admingroup | ssh
      

      Additional Information

      The problematic part is the users configuration in custom-realm.xml

      Compare

      karaf@root()> env karaf.etc
      String          karaf.etc       C:\r1\t1\n1\2\apache-karaf-4.1.4\etc
      

      to the values obtained when debugging PropertiesBackingEngineFactory:

      This issue seems to have existed in the past (KARAF-2226), but the described workaround does not exist anymore and was deleted from the documentation (KARAF-3162)

      Attachments

        1. BackingEngineFactoryDebugger.jpg
          54 kB
          Robert Schulte
        2. custom-realm.xml
          0.5 kB
          Robert Schulte

        Activity

          People

            Unassigned Unassigned
            Robert Schulte Robert Schulte
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: