【问题标题】:Worklight LTPA Authentication with WebSphere使用 WebSphere 的 Worklight LTPA 认证
【发布时间】:2014-05-20 14:22:26
【问题描述】:

您好,我正在使用 Worklight 6.1 和 WebSphere 8

我收到以下错误

[错误] FWLSE0059E: 登录领域“WASLTPAModule”失败。 SRVE0190E: 找不到文件:/login.html。 [project Streebo] SRVE0190E:找不到文件:/login.html [错误] FWLSE0117E:错误代码:4,错误描述:AUTHENTICATION_ERROR,错误消息:使用 loginModule WASLTPAModule 执行身份验证时出错,用户身份不可用。 [project Streebo] [project Streebo] [WARNING] 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,

ma​​in.js

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);

};

所以它的成功功能以及当它调用适配器并出现以下错误时

[错误] FWLSE0059E: 登录领域“WASLTPAModule”失败。 SRVE0190E: 找不到文件:/login.html。 [项目斯特里博] SRVE0190E: 找不到文件:/login.html [错误] FWLSE0117E:错误代码:4,错误描述:AUTHENTICATION_ERROR,错误消息:使用 loginModule WASLTPAModule 执行身份验证时出错,用户标识不可用。 [项目 Streebo] [项目 Streebo] [警告] SRVE0190E:找不到文件:/login.html

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

请指导我解决此问题

欣赏

【问题讨论】:

    标签: ibm-mobilefirst


    【解决方案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

    【讨论】:

    • 如上更改 login.html 后,有一次我在 logcat 中看到了 html,但它又开始给我同样的错误,有什么想法吗?我看了你建议的文章,看起来和我实现的一样,现在我卡住了,真的不知道从哪里开始
    • 您好,如何将html文件放在war文件的根目录下?当 Eclipse 生成我的战争文件时,我需要手动执行还是有办法将它放在正确的位置?
    【解决方案2】:

    对于 MobileFirst Platform v6.3

    \MobileFirstServerConfig\servers\worklight\apps

    找到您正在尝试测试 ltpa 的应用程序。

    假设项目名称是 FormBasedAuth。那么对应的war文件就是FormBasedAuth.war

    用WinRAR打开。

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

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

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

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

    现在,当您进行测试时,此错误将消失。

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-12-12
      • 1970-01-01
      • 1970-01-01
      • 2014-04-09
      • 2013-02-14
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多