如何使用angular处理第三方api post请求?

问题描述

我正在尝试将我的应用程序与 okta 集成。我的node js代码是这样的。

// saml strategy for passport
var strategy = new saml(
    {
        entryPoint: 'https://xxx.okta.com/app/dev-78419541_xxxxsaml_1/exkrzdlpdRCIMy4JO5d6/sso/saml',issuer: 'http://www.okta.com/exkrzdlpdRCIMy4JOxx6',callbackUrl: 'https://localhost:3000/app',cert: 'xxxxx'
     },(profile,done) => {
        userProfile = profile;
        done(null,userProfile);
    }
);

passport.use(strategy);


app.get('/',passport.authenticate('saml',{
    successRedirect: '/app'
  }));
  
app.post('/app',function(req,res) {
        const xmlResponse = req.body.SAMLResponse;
        const parser = new Saml2js(xmlResponse);
        console.log(parser.parsedSaml);
        res.send(parser.parsedSaml);
    }
);

所有这些都在工作,我在 dom 上得到了这个输出

{"userFirstName":"xxx","userLastName":"xxx","userEmail":"xxxx","userLogin":"xxx","userDevice":"xxx"}

如果我必须处理 dom 上的这些数据,我该怎么办才能使用一些 angular App 进行处理。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)