简体   繁体   English

扩展WSO2 Identity Server JDBCUserStoreManager以适合外部用户数据库

[英]Extending WSO2 Identity Server JDBCUserStoreManager to fit external user database

We have a requirement to authenticate users of a web application deployed in WSO2 Application Server against an existing external database. 我们需要针对现有外部数据库对在WSO2 Application Server中部署的Web应用程序的用户进行身份验证。 We are trying using WSO2 Identity Server for this. 我们正在尝试为此使用WSO2 Identity Server。

Our db table containing users has two columns which make a username unique, clientid and usercode. 我们的包含用户的数据库表具有两列,这两个列使用户名唯一,即clientid和usercode。 ie usercode is not unique by itself but clientid+usercode is unique. 即用户代码本身不是唯一的,但clientid + usercode是唯一的。 Also our passwords are salted with PBKDF2. 同样,我们的密码也与PBKDF2结合使用。 So I have extended the JDBCUserStoreManager to talk to our database and am able to store and retrieve passwords in PBKDF2. 因此,我扩展了JDBCUserStoreManager来与我们的数据库对话,并能够在PBKDF2中存储和检索密码。

But I cant figure out how I can get the client id from the login page to our extended JDBCUserStoreManager. 但是我无法弄清楚如何从登录页面获取客户端ID到扩展的JDBCUserStoreManager。 ie how can I access clientid stored in users session, from inside our custom JDBCUserStoreManager? 即如何从我们的自定义JDBCUserStoreManager内部访问存储在用户会话中的clientid? If I can get the clientid from the session in there, I can use it in the sql queries to do the needful. 如果我可以从那里的会话中获取clientid,则可以在sql查询中使用它来做有需要的事情。

Any help in figuring this out is much appreciated.. 非常感谢您帮助解决此问题。

You can enter the combination "clientid+usercode" as the username at the login page. 您可以在登录页面上输入“ clientid + usercode”组合作为用户名。 Then the authenticator will pass that combination as the username to the doAuthenticate() method of your custom userstore manager. 然后,身份验证器会将该组合作为用户名传递给自定义用户存储管理器的doAuthenticate()方法。 There you can split the client id and usercode from the username. 在那里,您可以从用户名中拆分客户端ID和用户代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM