on 2024 Jul 09 9:39 AM
Hello community,
I would like to connect CAP Node.js app to external SAP service in production env using destinations. It is important to use OAuth2.0ClientCredentials authentication method. Sandbox works for me. Official document is bit confusing.
When I run production profile, I am getting below error. Do I need any additional NPM package, or require additional configuration in package.json or elsewhere?
What to do in order to successfully fetch data from "production" environment? Thank you.
package.json
"cds": {
"requires": {
"Some_ExternalServiceV4": {
"kind": "odata",
"model": "srv/external/Some_ExternalServiceV4",
"[sandbox]": {
"credentials": {
"url": "https://sandbox.api.sap.com/sappricing/datafetch"
}
},
"[production]": {
"credentials": {
"destination": "datafetch-destination"
}
}
}
}
}
According to the error:
Error: Authentication kind "jwt" configured, but no SUAA instance bound to the application. Either bind an IAS instance or switch to an authentication kind that does not require a binding.
It seems your application isn't bound to the necessary service instances in SAP BTP, such as XSUAA.
You might need the @Sisn/xssec package to authenticate users via JWT tokens.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Arley, Thanks for feedback. Actually, I had installed that package already, as it was explained here: https://cap.cloud.sap/docs/node.js/authentication#jwt
@Arley, Do I need any any additional config in file: xs-security.json or something else. I am using Web based IDE version BAS and application is being tested locally only, hence it's not deployed yet.
To see all default configurations, run:
cds env get requires
What to use depends on your environment (Cloud Foundry, Kubernetes / Kyma, ...). Here you can find more information about the topic:
https://cap.cloud.sap/docs/node.js/cds-connect#service-bindings
User | Count |
---|---|
71 | |
10 | |
8 | |
7 | |
7 | |
6 | |
6 | |
6 | |
6 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.