简体   繁体   English

使用Salesforce的SSO使用SAML2返回AuthnFailed错误

[英]SSO with salesforce using SAML2 returning AuthnFailed error

My app is developed in Laravel 5.5. 我的应用程序是在Laravel 5.5中开发的。 I am using laravel-saml2 package for setting up Service provider on my app. 我正在使用laravel-saml2软件包在我的应用上设置服务提供商。 I am trying to configure SSO with Salesforce. 我正在尝试使用Salesforce配置SSO。 I setup the IDP in salesforce from SP metadata. 我从SP元数据在Salesforce中设置IDP。

I am getting redirected to salesforce for login. 我将重定向到Salesforce进行登录。 After submitting form, I am getting back to my app https://xxx/saml2/acs with following error message 提交表单后,我返回到我的应用https:// xxx / saml2 / acs,并显示以下错误消息

array:2 [▼
  "code" => "urn:oasis:names:tc:SAML:2.0:status:AuthnFailed"
  "msg" => ""
]

Any help would be appreciated. 任何帮助,将不胜感激。

I fixed this problem. 我解决了这个问题。 This was due to Salesforce. 这是由于Salesforce。

You can check on the logs under 'Manage Users -> Identity Provider Event Log'. 您可以在“管理用户->身份提供商事件日志”下检查日志。 This could give reason for your error. 这可以为您的错误提供原因。 I got a 'Error: User does not have access to this service provider' error. 我收到“错误:用户无权访问此服务提供商”错误。 For this, the user was not given permission. 为此,未向用户授予权限。 Even if the user is System Administrator, the access to Connected App is not given by default. 即使用户是系统管理员,默认情况下也不授予对Connected App的访问权限。

To give permission, go to 'Manager Users -> Users' and click edit on the user you are testing.Click profile name link .eg System Administrator. 要授予权限,请转到“管理员用户->用户”,然后在要测试的用户上单击编辑。单击配置文件名称链接.eg系统管理员。 This takes to profile page. 这将转到个人资料页面。 You can scroll below to 'Connected App Access' and you would see that the access is not given. 您可以在下面滚动到“已连接的应用程序访问”,然后会看到未提供访问权限。 Give the access by clicking edit profile in the top of page. 通过单击页面顶部的编辑配置文件来授予访问权限。

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

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