on 2022 Oct 07 12:46 PM
Here is my scenario:
We have BTP Launchpad, with dynamic tiles. We want to tile count to come from our nodejs application hosted in CloudFoundry. We have a destination in BTP which points to the nodejs application, and allows us to "speak" to it with no authentication, i.e. I am able to do a GET request to the node layer and return a JSON object with a "number" property, and it displays. But I now need it to get the "number" data from a backend system, rather than hardcoded.
The nodejs application has SSO configured (Principal Propagation) for a destination to the backend system SAP system.
So what we want:
It's point 2 that I'm stuck with.
This is my destination:
(Client ID and Secret are taken from my nodejs application, in the environment variable for the xsuaa):
And the token service URL is from my Launchpad here:
What Authentication type should I be using? I want the request data in my node logic to contain the relevant tokens/cookies/etc to pass this through to my backend SSO login:
When I make the axios.get request to the authorization endpoint on this URL:
And I try passing in the same request headers that I got from Launchpad, it doesn't work...
This returns nothing, so I added in "await" before the axios request, and tried changing the response to "response.data" but still nothing comes back.
I keep getting this as a response to my tile-count request:
I get no additional information in my logs. I have no idea if the axios.get even got anything back, but I assume it didn't get "header.Location", which I think is what I need according to this article:
I’ve tried adding in logging before and after my AXIOS get request, but with the “await” I never get anything logged after the request, which tells me the 404/422 is from the axios request, and if I remove the “await” I get the logs but nothing from the request as it isn’t finished when the logs are hit.
Any advice would be amazing please! I’m not very familiar with any of this authentication or nodejs, so I may be barking up the wrong tree!
Any reason why you can't just remove the Node.JS part, configure your xs-app.json to proxy to the SAP System and setup the crossNavigation seciton of your manifest.json to point to the $count endpoint?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I wish we could. In fact my "solution" to all of this was that I built a simple little Gateway OData service in our backend which I then connected through to using Principle Propagation for SSO from Launchpad, and it works perfectly. And is for me the desirable solution: simple, and it was SO quick to build!
However we have a large application running on our nodejs server, and all api calls are made through this nodejs server for the rest of the application. And although our dev system had Gateway in backend, it doesn't exist across the landscape, so would require a lot of upgrade. Also the counts which we want to show on Launchpad already have an API for them in the nodejs server, since we actually have a bespoke launchpad-type-view which displays counts. But for users who want to integrate the application(s) into Launchpad they need the counts there.
I have made some progress with this thanks to this and I'ms using auth type "OAuth2JWTBearer" on the destination, which seems to be working I think.. and I've had a lot of support from the colleague of mine who wrote the SSO logic into our nodejs application. So now I this I am authenticating but I now need to get the data from the backend, and that I cannot yet do, but I think I'm close...
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.