简体   繁体   English

如何使用 React 应用程序在 saml 身份验证中捕获 SAML 响应

[英]How to catch SAML response in saml authentication with react application

We are trying to implement SAML authentication with React App where we are using Azure Directory as IDP, when the user gets authenticated UI gets SAML response in HTTP post request payload.我们正在尝试使用 React App 实现 SAML 身份验证,其中我们使用 Azure 目录作为 IDP,当用户通过身份验证时 UI 在 HTTP 发布请求有效负载中获得 SAML 响应。 But on the client-side (React) we are not able to read this request payload.但是在客户端(React)我们无法读取这个请求负载。

Azure AD will post the SAML response to the Redirect URI of the SP . Azure AD 会将 SAML 响应发布到 SP 的重定向 URI In order to process it you will need server-side logic.为了处理它,您将需要服务器端逻辑。 You can enable SSR for React or create and API that handles the auth callback and forwards the results to the SPA.您可以为 React 启用 SSR 或创建处理身份验证回调并将结果转发到 SPA 的 API。

Take a look to Simple React and Express app SAML login by Okta for a React SPA + Node.js/Express API sample.查看Okta 的 Simple React 和 Express 应用 SAML 登录以获取 React SPA + Node.js/Express API 示例。

Hope that helps!希望有帮助!

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

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