【问题标题】:Cloud Identity Platform: Are IdP-initiated SAML flows possible?Cloud Identity Platform:IdP 发起的 SAML 流是否可行?
【发布时间】:2019-09-26 11:55:22
【问题描述】:

Google Cloud Identity Platform 有 documentation 用于服务提供商启动的 SAML 身份验证流。在搜索文档和在线后,我找不到任何关于身份提供者启动的流程的信息。

IdP 是否完全支持 IdP 发起的 SAML 流?假设我使用的是 firebase JS SDK,接收 IdP SamlResponse POST 会是什么样子?

谢谢!

【问题讨论】:

    标签: firebase google-cloud-platform firebase-authentication


    【解决方案1】:

    我刚刚发现current docs呼出:

    目前,仅支持通过 Web SDK 发起的服务提供商 (SP) 发起的 SAML 流。

    【讨论】:

      【解决方案2】:

      我们可以创建自己的 ACS 处理程序端点

        route.post('/sso/callback', (samlResponse) => {
         // 1. Use passport saml or saml2 to parse the saml response
         // 2. Then create a claim
          const userId = samlResponse.user.uid;
          const additionalClaims = {
            premiumAccount: true,
            userGroups: []
          };
          
          admin
            .auth()
            .createCustomToken(userId, additionalClaims)
            .then((customToken) => {
              // Send token back to client
            })
            .catch((error) => {
              console.log('Error creating custom token:', error);
            });
          });
      
      

      然后在客户端应用程序中

      firebase.auth().signInWithCustomToken(token)
        .then((userCredential) => {
          // Signed in
          var user = userCredential.user;
          // ...
        })
        .catch((error) => {
          var errorCode = error.code;
          var errorMessage = error.message;
          // ...
        });
      
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-12-22
        相关资源
        最近更新 更多