3

我正在尝试从 S4hana 云读取数据。我在 Cloud Foundry 中配置了身份验证类型为OAuth2SAMLBearerAssertion的目的地。

我还编写了一个小 servlet 来使用 VDM 机制获取数据。

但是当我调用端点时,我遇到了错误

 Caused by: com.sap.cloud.sdk.cloudplatform.connectivity.TokenRequestFailedException: Failed to get access token: no valid JWT bearer found in "Authorization" header of request.
   2018-10-09T15:34:52.84+0530 [APP/PROC/WEB/0] OUT     at com.sap.cloud.sdk.cloudplatform.connectivity.TokenRequest.getCurrentJwt(TokenRequest.java:308)
   2018-10-09T15:34:52.84+0530 [APP/PROC/WEB/0] OUT     at com.sap.cloud.sdk.cloudplatform.connectivity.TokenRequest.requestTokenWithUserTokenGrant(TokenRequest.java:352)
   2018-10-09T15:34:52.84+0530 [APP/PROC/WEB/0] OUT     at com.sap.cloud.sdk.cloudplatform.connectivity.XsuaaService.requestAccessToken(XsuaaService.java:135)
   2018-10-09T15:34:52.84+0530 [APP/PROC/WEB/0] OUT     at com.sap.cloud.sdk.cloudplatform.connectivity.XsuaaService.getServiceToken(XsuaaService.java:197)
   2018-10-09T15:34:52.84+0530 [APP/PROC/WEB/0] OUT     at com.sap.cloud.sdk.cloudplatform.connectivity.DestinationServiceCommand.getAccessToken(DestinationServiceCommand.java:109)
   2018-10-09T15:34:52.84+0530 [APP/PROC/WEB/0] OUT     ... 31 common frames omitted

我已关注https://blogs.sap.com/2018/02/05/deep-dive-8-with-sap-s4hana-cloud-sdk-leverage-principal-propagation-via-oauth-2-when-sumption -a-business-api-from-s4hana-cloud/

4

1 回答 1

1

您是否设置了安全性/配置了应用路由器?

错误消息表明请求中缺少 JWT。

另请参阅:https ://blogs.sap.com/2017/07/18/step-7-with-sap-s4hana-cloud-sdk-secure-your-application-on-sap-cloud-platform-cloudfoundry/

于 2018-10-09T10:31:04.283 回答