微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

如何解决如何使用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 举报,一经查实,本站将立刻删除。