在SAP SuccessFactors中设置OAuth身份验证
为了从成功因素ODATA服务中获取ODATA,我正在尝试通过创建
使用Postman一切正常工作,但是,一旦我检查了先前创建的目标的连接,收到的响应为 401:未经授权。
我知道这是错误的,但是,出于好奇心,我也创建了一个没有身份验证的目的地。然后直接从代码中开发了三个嵌套的Ajax请求。首先提供断言,其次是用户令牌,第三是利用令牌,获得ODATA的断言。可悲的是,响应始终是 401:未经授权。
在最后一个AJAX请求的代码下方,其他两个很好:
// Validate access token
$.ajax({
type: 'GET',
headers: {
"Authorization": "Bearer " + sAccessToken
},
url: '/oauth/validate',
success: function(data){
console.log("Success: ", data);
},
error: function(e){
console.log(e);
}
});
这里请求标头:
In order to get oData from success factors odata service, I'm trying to setting up a connection between SuccessFactors and SAP BTP by creating a destination as reported in this official guide.
Using postman everything works fine but, once I check the connection of destination previously created, the response received is 401: Unauthorized.
Below the configuration of destination:
Here you can see the properties:
I know that is wrong but, for the sake of curiosity, I've also created a different destination with no authentication. Then directly from code I've developed three nested ajax requests. First provides the assertion, second the user token, third is the one which, leveraging the token, get the odata. Sadly response is always 401: Unauthorized.
Below the code of last ajax request, the other two are good:
// Validate access token
$.ajax({
type: 'GET',
headers: {
"Authorization": "Bearer " + sAccessToken
},
url: '/oauth/validate',
success: function(data){
console.log("Success: ", data);
},
error: function(e){
console.log(e);
}
});
Here the request header:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
因此,不确定您的流程如何。通常,您将通过具有
xs-app.json
的SAP Axpoututer连接到BTP,该Appouter 定义了要使用的路由和目的地。然后,Applouter将向内部BTP JWT与SAML主张成功交换了成功量。如果您想通过BTP目标服务向您自己请求身份验证Infos,则必须通过HTTP Header FieldX-user-toke将有效 btp JWT发送到目标服务,作为响应,您将获得成功的Farefactors Oauth Bearer令牌。
请参阅此处
希望它有助于
问候
MATHIAS
So not sure how your flow really is. Normaly you would connect to BTP via a SAP Approuter which has a
xs-app.json
which defines the routes and destinations to use. Then the Approuter would Exchange the internal BTP JWT with a SAML Assertion for Successfactors. If you want to request the authentication infos for yourself via the BTP Destination Service, you have to send a valid BTP JWT to the destination service via the HTTP Header fieldX-user-token
and as a response you would get back a Successfactors OAuth bearer token.See here
hope it helps
Regards
Mathias