on 04-04-2022 12:26 PM
https://help.sap.com/doc/88b0d45562c04571a8d117bc8b6b3b7a/1.0/en-US/modules/_sap_cloud_sdk_core.html
Hello,
Is there a way to retrieve the AuthInfo and Subdomain from a incomming request using the cloud sdk? I do not see an available interface to pull either on the documentation above.
For reference, when xsuaa is active on a CAP project - All Incomming requests contain the 'authInfo' object with useful methods such as: getZoneId(), getSubdomain().
I'd like to be able to also pull this values through the SDK.
context.req.authInfo.getZoneId()
context.req.authInfo.getSubdomain()
What's about using the fields:
"subaccountid": "Subaccount GUID",
"zdn": "domain",
from the JWT?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey akloske, I think Gregor's suggestion currently is the best option. You can use the decodeJwt function and then read the sub and zid values if you need those. If this does not meet your requirements, I suggest to create a feature request here.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
BTW, I realized that you are looking at a very old version of the API docs. You can find the latest API reference here. I highly recommend to upgrade to version 2.
User | Count |
---|---|
76 | |
10 | |
8 | |
6 | |
6 | |
6 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.