简体   繁体   English

OpenID Keycloak领域的自定义身份验证器

[英]Custom Authenticator for OpenID Keycloak realm

I am currently evaluating keycloak as central Identity Manager for multiple a backend with multiple REST services (Resteasy/Wildfly). 我目前正在评估keycloak作为多个后端和多个REST服务(Resteasy / Wildfly)的中央Identity Manager。

After a lot of trial and error and reading the docu, I have succeeded in succesfully making an openid connect login into my custom keycloakrealm (analogue to this post http://blog.keycloak.org/2015/10/getting-started-with-keycloak-securing.html ) 经过大量的反复试验和阅读文档,我成功地将openid connect登录到我的自定义keycloakrealm(类似于这篇文章http://blog.keycloak.org/2015/10/getting-started-with -keycloak-secured.html

I can see the acces token + id_token coming in the response and are able to make requests to the REST services by passing these tokes. 我可以看到来自响应的acces token + id_token,并且能够通过传递这些tokes来向REST服务发出请求。

However I can only authenticate using the credentials of the users defined in keycloak itself. 但是,我只能使用keycloak本身定义的用户凭据进行身份验证。 However, in our reallife case, the users reside in SAP and are unknown to keycloak. 但是,在我们的reallife案例中,用户驻留在SAP中并且不知道keycloak。

We do, however have a javalibrary for authenticating these users over the SAPJCO connector. 但是,我们有一个javalibrary用于通过SAPJCO连接器验证这些用户。

Can anyone please tell me how to configure keycloak to use a "custom authentication" module for the actual authentication? 任何人都可以告诉我如何配置keycloak使用“自定义身份验证”模块进行实际身份验证?

Is implementing a custom authenticator SPI ( https://keycloak.gitbooks.io/server-developer-guide/content/v/2.1/topics/auth-spi.html ) the way to go? 正在实施自定义验证器SPI( https://keycloak.gitbooks.io/server-developer-guide/content/v/2.1/topics/auth-spi.html )的方法吗? If not, what wuold be a possible solution??? 如果没有,那么什么是可能的解决方案?

Hope you guys can help! 希望你们能帮忙!

Reagrds, Reagrds,

Kim Zeevaarders The Netherlands Kim Zeevaarders荷兰

If you can access the SAP users details via the SAPJCO connector then you could write a custom Federation Provider . 如果您可以通过SAPJCO连接器访问SAP用户详细信息,那么您可以编写自定义联合提供程序 The provided example is rudimentary but it give the basic idea and maven dependencies. 提供的示例是基本的,但它给出了基本思想和maven依赖。

In a nutshell you will need to extend org.keycloak.models.UserFederationProvider and provide methods for obtaining user details, validation of credentials and searching by attributes. 简而言之,您需要扩展org.keycloak.models.UserFederationProvider并提供获取用户详细信息,验证凭据和按属性搜索的方法。 In your case you would use your SAPJCO connector to fulfil each of these functions against your existing user base. 在您的情况下,您将使用SAPJCO连接器来完成针对现有用户群的每个功能。

Update 30 May 2018 2018年5月30日更新

The User Federation SPI was replaced with a new User Storage SPI in release 2.5. 用户联合SPI已在2.5版中替换为新的用户存储SPI Migration Notes are available here 迁移说明可在此处获得

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

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