Java 在angular 8应用程序中,如何从浏览器中获取网络选项卡标题部分下具有SAML响应的表单数据详细信息?

Java 在angular 8应用程序中,如何从浏览器中获取网络选项卡标题部分下具有SAML响应的表单数据详细信息?,java,angular,saml,idp,Java,Angular,Saml,Idp,我正在尝试在angular 8应用程序中执行IDP身份验证。因此,我的angular应用程序首先重定向到IDP服务器,然后IDP服务器为我提供SAML响应以获得进一步授权。此SAML响应可在浏览器的“表单数据”部分的“网络”选项卡中找到。我想在angular应用程序中获取此SAML响应以获取我的id和电子邮件详细信息,以便进一步解码并使用它进行授权。因此,我的问题是,如何从浏览器获得SAML响应并在angular应用程序中使用相同的响应。请帮助。我可以在浏览器的“网络”选项卡的“标题”选项卡“具

我正在尝试在angular 8应用程序中执行IDP身份验证。因此,我的angular应用程序首先重定向到IDP服务器,然后IDP服务器为我提供SAML响应以获得进一步授权。此SAML响应可在浏览器的“表单数据”部分的“网络”选项卡中找到。我想在angular应用程序中获取此SAML响应以获取我的id和电子邮件详细信息,以便进一步解码并使用它进行授权。因此,我的问题是,如何从浏览器获得SAML响应并在angular应用程序中使用相同的响应。请帮助。我可以在浏览器的“网络”选项卡的“标题”选项卡“具有表单数据”部分下看到我的SAML响应。

我通过在angular项目中编写index.jsp文件实现了这一点

<%
     String uiBaseUrl = "/ngApp";
     String samlResponse = request.getParameter("SAMLResponse");
     if (samlResponse == null) {
         String error = request.getParameter("error");
         String error_description = request.getParameter("error_description");
 %>
        <script>
            let url = '<%= uiBaseUrl %>' + '/?error='+encodeURIComponent(error)+'&error_description='+encodeURIComponent(error_description);
            window.location.href = url;
        </script>
 <% } else { %>
        <script>
            redirectToUI();
            function redirectToUI() {
                const samlResponse = '<%=samlResponse%>';
                localStorage.setItem('SAMLResponse', samlResponse);
                let url = '<%= uiBaseUrl %>';
                window.location.href = url;
                /*This will navigate to ng App base route with SAMLResponse in localStorage. Write logic in base route component to read this response*/
            }
        </script>
 <% } %>

让url=''+'/?error='+encodeURIComponent(error)+'&error\u description='+encodeURIComponent(error\u description);
window.location.href=url;
toui();
函数重定向toui(){
const samlResponse='';
setItem('SAMLResponse',SAMLResponse);
让url='';
window.location.href=url;
/*这将导航到localStorage中具有SAMLResponse的ng应用程序基本路由。在基本路由组件中写入逻辑以读取此响应*/
}

我通过在angular项目中编写index.jsp文件实现了这一点

<%
     String uiBaseUrl = "/ngApp";
     String samlResponse = request.getParameter("SAMLResponse");
     if (samlResponse == null) {
         String error = request.getParameter("error");
         String error_description = request.getParameter("error_description");
 %>
        <script>
            let url = '<%= uiBaseUrl %>' + '/?error='+encodeURIComponent(error)+'&error_description='+encodeURIComponent(error_description);
            window.location.href = url;
        </script>
 <% } else { %>
        <script>
            redirectToUI();
            function redirectToUI() {
                const samlResponse = '<%=samlResponse%>';
                localStorage.setItem('SAMLResponse', samlResponse);
                let url = '<%= uiBaseUrl %>';
                window.location.href = url;
                /*This will navigate to ng App base route with SAMLResponse in localStorage. Write logic in base route component to read this response*/
            }
        </script>
 <% } %>

让url=''+'/?error='+encodeURIComponent(error)+'&error\u description='+encodeURIComponent(error\u description);
window.location.href=url;
toui();
函数重定向toui(){
const samlResponse='';
setItem('SAMLResponse',SAMLResponse);
让url='';
window.location.href=url;
/*这将导航到localStorage中具有SAMLResponse的ng应用程序基本路由。在基本路由组件中写入逻辑以读取此响应*/
}

嗨,你运气好吗?我也在尝试做同样的事情,如果你有任何解决方案,请分享你有没有运气?我也在尝试做同样的事情,如果你有任何解决方案,请分享