使用WebSphere进行Worklight LTPA身份验证

时间:2014-05-20 14:22:26

标签: ibm-mobilefirst

您好我正在使用worklight 6.1和WebSphere 8

我收到以下错误

[错误] FWLSE0059E:登录领域'WASLTPAModule'失败。 SRVE0190E:找不到文件:/login.html。 [project Streebo] SRVE0190E:找不到文件:/login.html [错误] FWLSE0117E:错误代码:4,错误说明:AUTHENTICATION_ERROR,错误消息:使用loginModule执行身份验证时出错WASLTPAModule,用户身份不可用。 [项目Streebo] [项目Streebo] [警告] SRVE0190E:找不到文件:/login.html

以下是我所做的事情

authenticationConfig.xml

<mobileSecurityTest name="mobileTests">
<testAppAuthenticity/> 
<testDeviceId provisioningType="none" />
<testUser realm="WASLTPARealm" />
</mobileSecurityTest>


<!-- 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>


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

适配器条目

WASAuth.xml
<procedure name="getAuth" securityTest="mobileTests"/>

WASAuth-impl.js
function getAuth() {
return {'key1':'authh'};
}

挑战处理程序

var challengeHandler;
challengeHandler = WL.Client.createChallengeHandler('WASLTPARealm');

initOptions.js

connectOnStartup : false,

main.js

function wlCommonInit(){
WL.Client.connect({
    onSuccess: onConnectSuccess,
    onFailure: onConnectFailure
});

及其进入onSuccess

function onConnectSuccess() {
alert('on connect success in wlCommonInit() in main.js');

var invocationData = {
    adapter : 'WASAuth',
    procedure : 'getAuth',
    parameters : []
};

var options = {
    onSuccess : function(res) {
        alert('procedure getAuth success with res: '+res);          
    },
    onFailure : function() {
        alert('procedure getAuth Failures');
    }
};

WL.Client.invokeProcedure(invocationData, options);

};

所以它的成功功能以及何时调用适配器并跟随错误

[错误] FWLSE0059E:登录领域'WASLTPAModule'失败。 SRVE0190E:找不到文件:/login.html。 [项目Streebo] SRVE0190E:找不到文件:/login.html [错误] FWLSE0117E:错误代码:4,错误说明:AUTHENTICATION_ERROR,错误消息:使用loginModule执行身份验证时发生错误WASLTPAModule,用户身份不可用。 [项目Streebo] [项目Streebo] [警告] SRVE0190E:找不到文件:/login.html

我已经在我的战争的根文件夹中有login.html和loginError.html,并且在conf中也有login.html

请指导我解决此问题

欣赏

2 个答案:

答案 0 :(得分:1)

请确认您已将文件命名为login.html和loginError.html。另请确认您已将这些文件放在已部署到服务器的war文件的根目录中。您可以展开已部署的war文件以进行双重检查。还要确保您的login.html文件具有有效的结构,例如提供的示例:

<html>
  <head>
    <title>Login</title>
  </head>
  <body>
    <form method="post" action="j_security_check">
      <input type="text"
             id="j_username"
             name="j_username"
             placeholder="User name" />
      <input type="password"
             id="j_password"
             name="j_password"
             placeholder="Password" />
      <input type="submit" id="login" name="login" value="Log In" />
    </form>
  </body>
</html>

以及loginError.html页面的结构:

<html>
  <head>
    <title>Login Error</title>
  </head>
  <body>
    An error occurred while trying to log in.
  </body>
</html>

有关详细说明和故障排除,请查看以下内容:

LTPA培训模块: http://public.dhe.ibm.com/software/mobile-solutions/worklight/docs/v610/08_06_WebSphere_LTPA_based_authentication.pdf

LTPA信息中心说明 https://pic.dhe.ibm.com/infocenter/wrklight/v6r1m0/index.jsp?topic=%2Fcom.ibm.worklight.deploy.doc%2Fadmin%2Ft_configuring_WL_LTPA_realm.html

答案 1 :(得分:0)

适用于MobileFirst Platform v6.3

\ MobileFirstServerConfig \服务器\工作灯\应用

找到您尝试使用。

测试ltpa的应用

假设项目名称是FormBasedAuth。然后相应的war文件是FormBasedAuth.war

使用WinRAR打开它。

转到您的工作室工作台,在您的项目中&gt;展开服务器&gt; expand conf>将login.html复制到已在WinRAR中打开的FormBasedAuth.war

您还可以创建一个loginError.html并将其放入FormBaseAuth.war

确保将FormBaseAuth.war放回\ MobileFirstServerConfig \ servers \ worklight \ apps

现在在工作室,服务器视图&gt;停止测试服务器。等待它停止。 再次启动测试服务器。

现在测试时,此错误将消失。

独立服务器的类似过程,只是您的war文件可能不同。