Ibm mobilefirst Worklight LTPA与WebSphere的身份验证
您好,我正在使用worklight 6.1和WebSphere 8 我得到以下错误 [错误]FWLSE0059E:登录到域“WASLTPAModule”失败。SRVE0190E:未找到文件:/login.html。[project Streebo]SRVE0190E:找不到文件:/login.html[错误]FWLSE0117E:错误代码:4,错误描述:身份验证错误,错误消息:使用loginModule WASLTPAMULE执行身份验证时出错,用户标识不可用。[project Streebo][project Streebo][WARNING]SRVE0190E:找不到文件:/login.htmlIbm mobilefirst Worklight LTPA与WebSphere的身份验证,ibm-mobilefirst,Ibm Mobilefirst,您好,我正在使用worklight 6.1和WebSphere 8 我得到以下错误 [错误]FWLSE0059E:登录到域“WASLTPAModule”失败。SRVE0190E:未找到文件:/login.html。[project Streebo]SRVE0190E:找不到文件:/login.html[错误]FWLSE0117E:错误代码:4,错误描述:身份验证错误,错误消息:使用loginModule WASLTPAMULE执行身份验证时出错,用户标识不可用。[project Streebo]
<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>
以下是我所做的事情
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>
initOptions.js
connectOnStartup : false,
function wlCommonInit(){
WL.Client.connect({
onSuccess: onConnectSuccess,
onFailure: onConnectFailure
});
main.js
connectOnStartup : false,
function wlCommonInit(){
WL.Client.connect({
onSuccess: onConnectSuccess,
onFailure: onConnectFailure
});
它正在走向成功
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);
})
所以,它将进入success函数,当它调用适配器时,会出现以下错误
[错误]FWLSE0059E:登录到域“WASLTPAModule”失败。SRVE0190E:未找到文件:/login.html。[斯特雷博项目]
SRVE0190E:未找到文件:/login.html
[错误]FWLSE0117E:错误代码:4,错误描述:身份验证错误,错误消息:使用loginModule WASLTPAModule执行身份验证时出错,用户标识不可用。[斯特雷博项目][斯特雷博项目]
[警告]SRVE0190E:找不到文件:/login.html
<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>
我在war的根文件夹中已经有login.html和loginError.html,在conf中也有login.html
请指导我解决这个问题
非常感谢请确认您已准确地将文件命名为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培训模块:
LTPA信息中心说明
适用于MobileFirst平台v6.3 \MobileFirstServerConfig\servers\worklight\apps 查找您尝试使用其测试ltpa的应用程序 假设项目名称为FormBasedAuth。然后对应的war文件是FormBasedAuth.war 使用WinRAR打开它 转到studio工作台,在项目>扩展服务器>扩展配置>中将login.html复制到已在WinRAR中打开的FormBasedAuth.war中 您还可以创建loginError.html并将其放入FormBaseAuth.war中 确保将FormBaseAuth.war放回\MobileFirstServerConfig\servers\worklight\apps 现在在studio中,服务器视图>停止测试服务器。等它停下来。 再次启动测试服务器 现在,当您进行测试时,此错误将消失
对于独立服务器的类似过程,只是war文件可能不同 在如上所述更改login.html之后,有一次我在logcat中看到了html,但它又开始给我同样的错误,知道吗?我看了你建议的文章,看起来和我实现的一样,现在我被卡住了,真的不知道在哪里处理Hello,如何将html文件放在war文件的根目录中?当Eclipse生成war文件时,我是否需要手动执行此操作,或者是否有方法将其放在正确的位置?