【发布时间】:2020-03-02 18:36:18
【问题描述】:
我的cas配置如下
cas.authn.pac4j.typed-id-used=true
cas.authn.pac4j.oauth2[0].principal-attribute-id=preferred_username
cas.authn.pac4j.oauth2[0].id=xxxxxxxxxxxxxx
cas.authn.pac4j.oauth2[0].secret=xxxxxxxxxx
cas.authn.pac4j.oauth2[0].client-name=salesforce
cas.authn.pac4j.oauth2[0].auth-url=https://login.salesforce.com/services/oauth2/authorize
cas.authn.pac4j.oauth2[0].token-url=https://login.salesforce.com/services/oauth2/token
cas.authn.pac4j.oauth2[0].profile-url=https://login.salesforce.com/services/oauth2/userinfo
cas.authn.pac4j.oauth2[0].use-path-based-callback-url=false
cas.authn.pac4j.oauth2[0].profile-attrs.preferred_username=preferred_username
在登录页面中,我需要获取用户电子邮件 ID,并根据电子邮件 ID 从数据库中获取客户端 ID 和密码,然后在重定向 URL 中使用。
有可能实现吗?
【问题讨论】:
-
请详细说明您的登录流程。你指的是哪个登录页面?CAS登录页面还是oath服务器登录页面?
-
@leopal 喜欢 CAS 欢迎页面 -> 在 CAS 登录欢迎页面中显示 Salesforce、zoho 或标准登录页面等可用客户端。用户单击 salesforce 后 -> 要求用户输入电子邮件 ID。基于电子邮件 ID 查找客户端 ID 和密码。基本上想动态传递 id 和 secret。我正在检查 cas webflow 自定义以将标准登录页面更改为自定义并且不知道 pac4j 自定义。
-
当用户点击 salesforce 选项时,他会被重定向到外部系统,对吧?他提供了他的电子邮件,然后销售人员的回复返回给 cas。之后,cas 将经过身份验证的用户重定向到初始化登录过程的服务。那么您是否需要在初始服务中包含用户的其他属性?如果是,请检查attribute release。
-
@leopal 实际上没有。如果你看到我上面的配置,我没有给出 id 和 secret。我有多个 id 和 secret,从我的客户到客户。如果在此处配置 id 和 secret,则 cas 总是重定向到具有相同 id 的 salesfore。但是这个 id 会随着客户端的变化而变化。我需要一种方法来动态传递 id 和 secret
-
您使用的是哪个版本的 CAS? CAS 5.3? CAS 6.1?其他的?