cancel
Showing results for 
Search instead for 
Did you mean: 

Error: Authentication kind "jwt" configured, but no XSUAA instance bound to application

kaizen9
Explorer
0 Kudos
186

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.

kaizen9_0-1720512753336.png

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"
          }
        }
      }
    }
  }

 

 

Arley
Product and Topic Expert
Product and Topic Expert
0 Kudos

To see all default configurations, run:

cds env get requires

 

Accepted Solutions (0)

Answers (1)

Answers (1)

Arley
Product and Topic Expert
Product and Topic Expert
0 Kudos

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 @Sap/xssec package to authenticate users via JWT tokens.

kaizen9
Explorer
0 Kudos

@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

kaizen9_0-1720703424386.png

 

kaizen9
Explorer
0 Kudos

@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.

kaizen9_0-1720709972903.png

 

Arley
Product and Topic Expert
Product and Topic Expert

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