[英]Keycloak: How to hook into Google Identity Provider to add roles programmatically
We use Keycloak with Google IDP to authenticate.我们使用 Keycloak 和 Google IDP 进行身份验证。 When a user log in using Google, I want to hook into the flow to add some roles for that user session.
当用户使用 Google 登录时,我想加入流程以为该用户 session 添加一些角色。
What should I do?我应该怎么办? I have tried creating to custom Authenticator but not sure this is the possible or best practice.
我尝试创建自定义身份验证器,但不确定这是可能的还是最佳实践。
Please help!请帮忙! Thanks!
谢谢!
When a user log in using google, I want to hook into the flow to add some roles for that user session.
当用户使用 google 登录时,我想加入流程以为该用户 session 添加一些角色。
Not sure what you do mean by roles to the user session.不确定您对用户 session 的角色意味着什么。 However, if you mean add roles to the user yes you can do that out of the box for instance:
但是,如果您的意思是向用户添加角色,是的,您可以开箱即用地执行此操作,例如:
Mapper Type
: Hardcoded Role
Mapper Type
: Hardcoded Role
Here is the list of Mapper Types available for the Google IDP:以下是可用于 Google IDP 的映射器类型列表:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.