cancel
Showing results for 
Search instead for 
Did you mean: 

connect SAPUI5-frontend to a XSUAA-protected backend (Internal Server Error)

jonasschilling
Explorer

Hello everyone,

I'm facing a problem with the connection from a SAPUI5 frontend to my backend.

I tried to connect my frontend to my xsuaa-protected backend by destination in the SCP. When I try to request the data from the backend I get an Internal Server Error. I think it has to be an issue with the xsuaa setup, because when I try to consume data from a backend with no authentification it works perfectly.

The authentication type of the destination is OAuth2JWTBearer.

I'll add my destination configuration and my xs-app.json to the question, maybe someone can find my mistake. Also I'll be happy if there would be any documents/instruction files how to set up xsuaa correctly because I've no experience in this topic.

xs-app.json:

{
	"welcomeFile": "/html/index.html",
	"authenticationMethod": "route",
	"logout": {
		"logoutEndpoint": "/do/logout"
	},
	"routes": [{
		"source": "^/REST/(.*)",
		"target": "/$1",
		"destination": "UAABackend",
		"authenticationType": "xsuaa"
	}, {
		"source": "^/html/(.*)$",
		"target": "$1",
		"localDir": "webapp"
	}]
}

Thank you all in advance!

Jonas

lucasvaccaro
Product and Topic Expert
Product and Topic Expert
0 Kudos

Check the logs of the approuter to see if there is anything that can help to figure out the cause. You can use this logcollector script: https://github.com/SAP/cloud-security-xsuaa-integration/tree/master/troubleshooting/logcollector

Accepted Solutions (0)

Answers (1)

Answers (1)

geert-janklaps
Active Contributor
0 Kudos

Hi,

I think what you're missing is an app router in your project. The app router handles the necessary handshakes with the XSUAA service and is able to forward the JWT token to your destination.

Some more info can be found here:

https://blogs.sap.com/2020/04/03/sap-application-router/?source=social-global-sapdevs-twitter-audien...

Best regards,

Geert-Jan Klaps