Question

Here is the error I receive from our WebSphere application server liberty profile running Worklight Server:

defaultOptions:onFailure Procedure invocation error. Runtime: The realm 'SingleStepAuthRealm' is not defined in authenticationConfig.xml.

This runs fine on my local server.

I have rebuilt and deployed the server customization WAR file to the server, and restarted it.

Could this be because the version of the remote server does not match up with the version of my local server? Local server version is: 5.0.5.20121129-1027

Here is my authenticationConfig.xml:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<tns:loginConfiguration xmlns:tns="http://www.worklight.com/auth/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

        <!-- Licensed Materials - Property of IBM
             5725-G92 (C) Copyright IBM Corp. 2006, 2012. All Rights Reserved.
             US Government Users Restricted Rights - Use, duplication or
             disclosure restricted by GSA ADP Schedule Contract with IBM Corp. -->  

    <!-- Uncomment the next element to protect the worklight console -->
    <!-- <staticResources>
        <resource id="worklightConsole" securityTest="WorklightConsole">
            <urlPatterns>/console*</urlPatterns>
        </resource>
    </staticResources> -->

   <!--  Sample security tests  
         Even if not used there will be some default  webSecurityTest and mobileSecurityTest 
         Attention: if using <testAppAuthenticity/> test below ,<publicSigningKey> element must be added to application-descriptor.xml as well. -->   
         
    <!-- <securityTests>
        
        <mobileSecurityTest name="mobileTests">
            <testAppAuthenticity/> 
            <testDeviceId provisioningType="none" />
            <testUser realm="myMobileLoginForm" />
        </mobileSecurityTest>

        <webSecurityTest name="webTests">
            <testUser realm="myWebLoginForm"/>
        </webSecurityTest>

        <customSecurityTest name="customTests">
            <test realm="wl_antiXSRFRealm" step="1"/>
            <test realm="wl_authenticityRealm" step="1"/>
            <test realm="wl_remoteDisableRealm" step="1"/>
            <test realm="wl_anonymousUserRealm" isInternalUserID="true" step="1"/>
            <test realm="wl_deviceNoProvisioningRealm" isInternalDeviceID="true" step="2"/>
        </customSecurityTest>
        
        <customSecurityTest name="WorklightConsole">
            <test realm="WorklightConsole" isInternalUserID="true"/>
        </customSecurityTest>

    </securityTests> -->
    
    <realms>
          <realm name="SingleStepAuthRealm" loginModule="SingleStepAuthLoginModule">
            <className>com.worklight.integration.auth.AdapterAuthenticator</className>
            <parameter name="login-function" value="SingleStepAuthAdapter.onAuthRequired" />
            <parameter name="logout-function" value="SingleStepAuthAdapter.onLogout" />
          </realm>
        
        <!-- For websphere -->
        <!-- realm name="WASLTPARealm" loginModule="WASLTPAModule">
            <className>com.worklight.core.auth.ext.WebSphereFormBasedAuthenticator</className>
            <parameter name="login-page" value="/login.html"/>
            <parameter name="error-page" value="/loginError.html"/>
        </realm -->
    </realms>

    <loginModules>
          <loginModule name="SingleStepAuthLoginModule">
            <className>com.worklight.core.auth.ext.NonValidatingLoginModule</className>
          </loginModule>
        
        <!-- For websphere -->
        <!-- loginModule name="WASLTPAModule">
            <className>com.worklight.core.auth.ext.WebSphereLoginModule</className>
        </loginModule -->
    </loginModules>

</tns:loginConfiguration>

UPDATE:

Thanks to Orlando's answer, I was able to discern the server versions:
Server version: 5.0.5.20121130-0919
Local version: 5.0.5.20121129-1027

The version (probably the build number, not sure how WL versions work) is different; however, I suspect that minor version mismatch is not the issue.

Here is what I have tried so far to debug this issue:

  1. I followed the steps in the worklight documentation to build and upload my server customization file to the proper directory on the server.

    You can find those steps in this IC article under the heading "Deploying a project".

  2. I opened up the WAR file and noticed that the authenticationConfig.xml is not in there! So, I figured I would manually push the XML up into the same folder that it resides in on my local server. In my case,this directory is: /opt/IBM/Worklight/server/wlp/usr/servers/worklightServer/worklight.home/app_name/conf

  3. I figured it might have been a permissions issue, so I set +rwx on the file. Still no dice.

  4. Maybe its looking for the other files that are in that directory on my local server? I uploaded all of them and tried the permissions again. No luck.

  5. I also restarted the server after each one of these steps (and in the case of step 4, restarted it twice, once with default perms and once with full perms).

Était-ce utile?

La solution 2

Have you tried the suggestion in this question?

Basically:

How many .war files do you have deployed in your application server?
In Worklight 5 there can be only 1. Make sure this is the case.

Autres conseils

Start by getting the (remote) server version as outlined here:

Worklight Server (All Editions)

If the server is up and running, you can find the version with the following steps. Otherwise continue to the next section.

  • Ensure your Worklight server is running.
  • Open the Worklight Console (http://:/worklight/console).
  • Click on the “About" link in the top right corner of the screen.
  • A pop-up will display showing the current server version

If the server is not running, you can find the version with the following steps.

  • Locate the directory where Worklight Server is installed (example.: C:\IBM\Worklight)
  • Navigate to \WorklightServer.
  • Open the file "worklight-jee-library.jar" using any archive tool that supports the "zip" format.
  • Once the jar is expanded, open the "conf/worklight.properties" file.
  • Within that file, the version number is defined by the "build.version" property.
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top