2013-03-15 24 views
0

我已经扩展AbstractUserStoreManager类并在doAuthenticate()方法中覆盖代码来执行自定义身份验证过程。当我使用凭证登录时,doAuthenticate方法正确返回true。wso2身份服务器 - 扩展AbstractUserStoreManager类和doAuthenticate()方法

但是,wso2身份服务器用户管理控制台仍在丢失登录失败消息。 (即正在调用CarbonAuthenticationUtil.onFailedAdminLogin方法)。

这可能是一个问题,无法显示该用户是否具有管理员角色。

但是,我在每种方法中都放了一些日志记录,以查看什么是触发。然而,我没有看到任何方法在doAuthenticate()方法被触发后检查角色被触发。

任何人都可以指向正确的方向吗?

这里是日志运行在DEBUG冗长:


[2013-03-15 15:17:55,669] DEBUG - getRequestAddressingRequirementParameterValue: got value from MessageContext [MessageContext: logID=cd1ae48ec92e8ccb25cd294c255c695acb01113f991655f8], value: 'null' {org.apache.axis2.addressing.AddressingHelper} 
[2013-03-15 15:17:55,669] DEBUG - getRequestAddressingRequirementParameterValue: value: 'null' {org.apache.axis2.addressing.AddressingHelper} 
[2013-03-15 15:17:55,669] DEBUG - getRequestAddressingRequirementParameterValue: value: 'null' {org.apache.axis2.addressing.AddressingHelper} 
[2013-03-15 15:17:55,670] DEBUG - [MessageContext: logID=dd1ae48ec92e8ccb25cd294c255c695acb01113f991655f8] isReplyRedirected: ReplyTo is null. Returning false {org.apache.axis2.addressing.AddressingHelper} 
[2013-03-15 15:17:55,670] DEBUG - [MessageContext: logID=dd1ae48ec92e8ccb25cd294c255c695acb01113f991655f8] isReplyRedirected: ReplyTo is null. Returning false {org.apache.axis2.addressing.AddressingHelper} 
[2013-03-15 15:17:55,670] INFO - isAuthenticated?: true {com.dg.rio.proxy.user.store.DGProxyReadOnlyUserStoreManager} 
[2013-03-15 15:17:55,670] DEBUG - Post authenticator is called in IdentityMgtEventListener {org.wso2.carbon.identity.mgt.IdentityMgtEventListener} 
[2013-03-15 15:17:55,670] DEBUG - Post authenticator is called in IdentityMgtEventListener {org.wso2.carbon.identity.mgt.IdentityMgtEventListener} 
[2013-03-15 15:17:55,671] DEBUG - AUTHORIZATION_CACHE Memory cache hit, but element expired {net.sf.ehcache.Cache} 
[2013-03-15 15:17:55,672] ERROR - System error while Authenticating/Authorizing User : null {org.wso2.carbon.core.services.authentication.AuthenticationAdmin} 
java.lang.NullPointerException 
    at org.wso2.carbon.user.core.authorization.JDBCAuthorizationManager.isUserAuthorized(JDBCAuthorizationManager.java:134) 
    at org.wso2.carbon.core.services.authentication.AuthenticationAdmin.login(AuthenticationAdmin.java:107) 

回答

1

的文档为4.10刚出来(上周我认为)。我阅读了关于配置外部ldap和jdbc存储的部分,它表示在领域配置中使用admin用户名(在user-mgt.xml中)。

   <AdminUser> 
       <UserName>MYADMINUSER</UserName> 

添加该用户名与arbitratory(后门)密码,并允许管理员用户使用有效的密码进行验证。即

如果doAuthenticate返回true,他将进行身份验证。如果错误,他会按预期被拒绝。

似乎有点傻,但很高兴看到它的工作。