on 2024 Oct 01 6:39 AM
Hello community.
i have followed this tutorial to add authentication in my cap project using xsuaa.
Add User Authentication to Your Application (SAP HANA Cloud) | SAP Tutorials.
in step 5 of this tutorial i got this particular type of error after using command "cds watch --profile hybrid".
{ "error": { "stack": "Error\n at reject (/home/user/projects/MyHANAApp5/node_modules/@sap/cds/libx/_runtime/common/generic/auth/utils.js:17:16)\n at ApplicationService.handler (/home/user/projects/MyHANAApp5/node_modules/@sap/cds/libx/_runtime/common/generic/auth/requires.js:37:3)\n at ApplicationService.handle (/home/user/projects/MyHANAApp5/node_modules/@sap/cds/lib/srv/srv-dispatch.js:52:53)\n at ApplicationService.handle (/home/user/projects/MyHANAApp5/node_modules/@sap/cds/libx/_runtime/common/Service.js:84:28)\n at run (/home/user/projects/MyHANAApp5/node_modules/@sap/cds/libx/_runtime/fiori/lean-draft.js:382:12)\n at onlyActives (/home/user/projects/MyHANAApp5/node_modules/@sap/cds/libx/_runtime/fiori/lean-draft.js:800:27)\n at cds.ApplicationService.handle (/home/user/projects/MyHANAApp5/node_modules/@sap/cds/libx/_runtime/fiori/lean-draft.js:423:26)\n at ApplicationService.dispatch (/home/user/projects/MyHANAApp5/node_modules/@sap/cds/lib/srv/srv-dispatch.js:35:15)\n at /home/user/projects/MyHANAApp5/node_modules/@sap/cds/lib/srv/srv-dispatch.js:15:48\n at ApplicationService.run (/home/user/projects/MyHANAApp5/node_modules/@sap/cds/lib/srv/srv-api.js:72:46)", "code": 401, "numericSeverity": 4 } }
while in this tutorial error is different
If you open the CAP service test page (cds watch --profile hybrid if you need to restart it) and try to access one of the service endpoints or metadata, you should receive an Unauthorized error.
This means your security setup is working. Accessing the CAP service directly will always produce an error now as there is no authentication token present. We need to run via the Application Router to generate and forward the authentication token.
please help and guide me in understanding the difference between the two errors for same problem .
Request clarification before answering.
User | Count |
---|---|
52 | |
6 | |
5 | |
5 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.