Skip to Content
0
Sep 23 at 04:01 PM

CAP Hybrid testing is not working: noAuthMethodFound when connecting to Hana

239 Views Last edit Sep 23 at 04:14 PM 9 rev

Hi colleagues, could you please help me with the hybrid profile setup on Trial account?

I currently have next .cdsrc-private.json:

{
   "requires":{
      "[hybrid]":{
         "db":{
            "binding":{
               "type":"cf",
               "apiEndpoint":"https://api.cf.us10-001.hana.ondemand.com",
               "org":"fcd0e122trial_fcd0e122trial",
               "space":"dev",
               "instance":"hana",
               "key":"hana-key",
               "resolved":false
            },
            "kind":"hana-cloud",
            "pool":{
               "acquireTimeoutMillis":5000,
               "min":0,
               "max":100,
               "fifo":true
            },
            "vcap":{
               "name":"db"
            }
         }
      }
   }
}<br>

also next package.json:

{
   ...,
   "cds":{
      "requires":{
         "[development]":{
            "db":{
               "kind":"sqlite",
               "credentials":{
                  "database":"sqlite.db"
               }
            },
            "auth":{
               "kind":"basic-auth",
               "users":{
                  "login":{
                     "password":"password",
                     "roles":[
                        "Approver",
                        "Commiter"
                     ]
                  }
               }
            }
         },
         "db":{
            "kind":"hana-cloud",
            "deploy-format":"hdbtable"
         },
         "auth":{
            "kind":"xsuaa",
            "pool":{
               "acquireTimeoutMillis":5000,
               "min":0,
               "max":100,
               "fifo":true
            }
         },
         "approuter":{
            "kind":"cloudfoundry"
         },
         "workflowService":{
            "kind":"rest",
            "credentials":{
               "destination":"bpmworkflowruntime"
            }
         }
      }
   }, ...
}

so when I try to launch the hybrid scenario it goes through the basic authentication, but then on first query to Hana it fails on the next source code with the last throw:

node_modules/hdb/lib/protocol/auth/Manager.js

function Manager(options) {
   options = options || {};
   this.user = options.user || '';
   this._authMethod = undefined;
   this._authMethods = [];
   if (options.assertion || (!options.user && options.password && options.password.toString().startsWith("<"))) {
      this._authMethods.push(new SAML(options));
   }
   if (options.token || (!options.user && options.password && options.password.toString().startsWith("ey"))) {
      this._authMethods.push(new JWT(options));
   }
   if (options.sessionCookie) {
      this._authMethods.push(new SessionCookie(options));
   }
   if (options.user && options.password) {
      this._authMethods.push(new SCRAMSHA256(options, true)); // with PBKDF2 
      this._authMethods.push(new SCRAMSHA256(options, false)); // no PBKDF2 
   }
   if (!this._authMethods.length) {
      throw noAuthMethodFound();
   }
}

the "options" variable contains next structure:

{
   "fetchSize":1024,
   "holdCursorsOverCommit":true,
   "scrollableCursor":true,
   "database":"sqlite.db",
   "certificate":"",
   "driver":"com.sap.db.jdbc.Driver",
   "host":"...",
   "port":"443",
   "uaa":{
      "bindingid":"someguid",
      "clientid":"...",
      "clientsecret":"...",
      "identityzone":"f...trial",
      "identityzoneid":"...",
      "tags":[
         "xsuaa"
      ],
      "tenantid":"...",
      "uaadomain":"authentication.us10.hana.ondemand.com",
      "url":"https://fcd0e122trial.authentication.us10.hana.ondemand.com",
      "verificationkey":"..."
   },
   "url":"jdbc:sap://someguid.hana.trial-us10.hanacloud.ondemand.com:443?encrypt=true&validateCertificate=true",
   "ca":"...",
   "useCesu8":true
}


The versions are:

cds -v
@sap/cds: 6.1.3
@sap/cds-compiler: 3.1.2
@sap/cds-dk: 6.1.1
@sap/cds-dk (global): 6.1.1
@sap/cds-foss: 4.0.0
@sap/cds-mtx: -- missing --
@sap/xssec: 3.2.13
Node.js: v16.17.0<br>

Thank you.