cancel
Showing results for 
Search instead for 
Did you mean: 

SAP BAS - Hybrid Testing - Authentication Fails - Could not obtain access token

tobiasfue
Explorer
0 Kudos

Hi,

I have 2 MTA projects in the same SubAccount and Space.

I can start one app in hybrid mode and also get access to the on-premise system successfully. The second app does not. Maybe I miss some "." after more than 3 hours, but I can't find any differences (apart from the different naming of the apps).

With the one project, I get the following message as soon as I start the app router and invoke it:

request to /login/callback?code=XOO completed with status 500 Could not authenticate with UAA: Could not obtain access token: request to authentication service at https://dev-XYZ.authentication.eu20.hana.ondemand.com/oauth/token failed, error: unexpected response from authentication service at https://dev-XYZ.authentication.eu20.hana.ondemand.com/oauth/token: status code: 401, response body: "undefined"
My Steps:
  1. cds bind -2 xsuaa-service:key
  2. cds bind -2 destination-services:key
  3. cds bind -2 connectivity-service:key
  4. cds add approuter
  5. npm install --prefix app
  6. cds bind --exec -- npm start --prefix app
  7. cds watch --profile hybrid

As I said, the one projects works fine, the other note.

In my VCAP-Enviroment Variables I can't see any difference (apart from the different names/urls. But the UAA URLs etc. are identical).

Both project's node packages have the same versions. Init today, so the newest cds packages...

I updated the xs-security service with new roles, but no difference at all. My user has no role whatsoever, for whatever reason that then works on the first app anyway... so this seems to have no effect in local testing?!?

XS-APP is exact the same... the hybrid binding looks fine/same.. With one service I am redirected to the SSO after a restart and with the other one I immediately get the error... Any ideas? Thanks..

{<br>  "authenticationMethod": "route",<br>  "routes": [<br>    {<br>      "source": "^/app/(.*)$",<br>      "target": "$1",<br>      "localDir": ".",<br>      "authenticationType": "xsuaa",<br>      "cacheControl": "no-cache, no-store, must-revalidate"<br>    },<br>    {<br>      "source": "^/(.*)$",<br>      "target": "$1",<br>      "destination": "srv-api",<br>      "authenticationType": "xsuaa",<br>      "csrfProtection": true<br>    }<br>  ]<br>}

Accepted Solutions (0)

Answers (0)