本文介绍了如何将 SAML 属性从服务提供商 (Salesforce) 传递到 Visualforce 页面控制器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

来自身份提供者(外部)的 SAML 响应包含作为单独属性的员工 ID,我需要在 Salesforce VisualForce 页面中显示该属性.因此,一旦通过 SSO 进行身份验证,请帮助我将属性从 saml 响应传递到 VF 页面.

SAML response from the identity provides(External) contains the Employee Id as a separate attribute which i need to display in Salesforce VisualForce Page. So help me in passing the attributes from saml response to a VF Page once authenticated via SSO .

提前致谢

推荐答案

你有自定义的 SAML 处理程序类吗?您可以在 SSO 设置(表单底部,JIT 部分)中生成一个模板,或者只是查看文档.https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_interface_Auth_SamlJitHandler.htmhttps://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_auth_plugin.htm.它们都包含一个 Map,SAML 断言中的所有属性都应传递到该映射.

Do you have a custom SAML handler class? You can generate a template one in SSO settings (bottom of the form, in JIT section) or just look around in documentation. https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_interface_Auth_SamlJitHandler.htm or https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_auth_plugin.htm. They both include a Map<String,String> to which all attributes from the SAML assertion should be passed.

一旦你的代码中有它们......不确定你是否可以直接从那里进行重定向,但应该不难将属性保存在用户的字段中或你真正需要的任何地方.然后查询 &在 VF 中显示?

Once you have them in your code... Not sure if you can do a redirect straight from there but shouldn't be hard to save the attribute in a field on User or wherever you need really. And then query & display it in VF?

如果您没有自定义处理程序而仅使用 SF 内置部分...如果参数具有正确的名称,则 SF 可能会为您保存它.您必须查看 https://help.salesforce.com/articleView?id=000329069&type=1&mode=1.如果您的参数采用 User.EmployeeNumber 格式(或自定义字段,如果您需要) - 有希望.如果没有 - 可能最简单的是使用自定义处理程序.

If you don't have a custom handler and just use SF built-in piece... If the parameter has right name there's a chance SF will save it for you. You'll have to look at https://help.salesforce.com/articleView?id=000329069&type=1&mode=1. if your param is in format User.EmployeeNumber (or custom field if you need one) - there's hope. If not - probably easiest is to use custom handler.

这篇关于如何将 SAML 属性从服务提供商 (Salesforce) 传递到 Visualforce 页面控制器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 15:20