IBM Worklight - 自定义认证

Posted

技术标签:

【中文标题】IBM Worklight - 自定义认证【英文标题】:IBM Worklight - Custom Authentication 【发布时间】:2014-06-02 11:04:26 【问题描述】:

当尝试使用自定义身份验证器和登录模块对适配器进行身份验证时,我面临以下异常。

[ERROR   ] FWLST0003E: ========= Failed starting project /CustomAuth [project CustomAuth]
Error creating bean with name 'taskManager' defined in URL [wsjar:file:/D:/worklight_workspace/WorklightServerConfig/shared/resources/worklight-jee-library-6.1.0.jar!/conf/core.xml]: Cannot resolve reference to bean 'worklightAuthenticationService' while setting bean property 'authenticationService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'worklightAuthenticationService' defined in URL [wsjar:file:/D:/worklight_workspace/WorklightServerConfig/shared/resources/worklight-jee-library-6.1.0.jar!/conf/core.xml]: Cannot create inner bean 'com.worklight.core.auth.impl.LoginConfigurationServiceBean#7cffa209' of type [com.worklight.core.auth.impl.LoginConfigurationServiceBean] while setting bean property 'loginConfigurationService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.worklight.core.auth.impl.LoginConfigurationServiceBean#7cffa209' defined in URL [wsjar:file:/D:/worklight_workspace/WorklightServerConfig/shared/resources/worklight-jee-library-6.1.0.jar!/conf/core.xml]: Invocation of init method failed; nested exception is java.lang.RuntimeException: Class 'com.mypackage.MyCustomLoginModule' defined in login module 'CustomLoginModule' in the authentication configuration file doesn't exist.
[AUDIT   ] CWWKZ0001I: Application CustomAuth started in 0.948 seconds.
[ERROR   ] SRVE0315E: An execption occurred: com.ibm.ws.webcontainer.webapp.WebAppErrorReport: javax.servlet.ServletException: Worklight Console initialization failed.Logged Exception: java.lang.RuntimeException: Class 'com.mypackage.MyCustomLoginModule' defined in login module 'CustomLoginModule' in the authentication configuration file doesn't exist.
    at com.worklight.core.auth.impl.AuthenticationFilter.verifyServletInitialized(AuthenticationFilter.java:300)
    at com.worklight.core.auth.impl.AuthenticationFilter.doFilter(AuthenticationFilter.java:111)
    at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:194)
    at [internal classes]
Caused by: javax.servlet.ServletException: Worklight Console initialization failed.Logged Exception: java.lang.RuntimeException: Class 'com.mypackage.MyCustomLoginModule' defined in login module 'CustomLoginModule' in the authentication configuration file doesn't exist.
    ... 5 more

你能帮帮我吗?

【问题讨论】:

阅读异常,遵循它提供的信息。验证您的课程是否已正确设置和引用? 【参考方案1】:

似乎您的项目战争由于某种原因不包含您的 java 类。我不知道为什么,需要更多信息,但我认为通过删除你的 bin 文件夹并重建所有工件,你将能够解决这个问题。

【讨论】:

【参考方案2】:

查看生成的二进制应用程序和 Worklight 服务器版本之间的 JDK 版本。您可以检查二进制文件是否是在基于 Windows 或 Unix 的操作系统中生成的,然后以服务器操作系统作为二进制应用程序的基础重新部署您的应用程序。

【讨论】:

【参考方案3】:

需要编写自己的java类进行自定义认证。在编写自定义身份验证方法时,这些 java 类将充当身份验证者和挑战者。

请找到documentation 用于基于 HTTP 的自定义身份验证。

【讨论】:

以上是关于IBM Worklight - 自定义认证的主要内容,如果未能解决你的问题,请参考以下文章

IBM Worklight 5.0.6 - 在推送通知错误时播放自定义声音

IBM Worklight 5.0.5 - 在推送通知上播放自定义声音

IBM Worklight 6.1 - 如何自定义 WL.BusyIndi​​cator 的高度和宽度?

如何使用自定义 IN 参数在 IBM Worklight SQL 适配器中调用存储过程

IBM Worklight - 如何定制 connectOnStartup 失败对话框

IBM Worklight 闪屏