on 07-13-2023 6:44 PM
Hi,
Initially, I built a standard-alone CAP project with "sap/cds5" module, and as per our use case, there is private entity and public entity which are defined in srv/private_srv.cds and srv/public_srv.cds file.
And we use following annotation to restrict the private entities can only be accessed by authenticated users.
@requires: 'authenticated-user'
But for public entities, we will not use above annotation, so that user can directly access the entity without authentication by calling public link: https://subaccount.cdsservice.com/public/myPublicEntity
This configuration is working perfectly when using "@sap/cds: 5" module.
But when we tried to upgrade the node module from version5 to version6.we found the authentication become mandatory for the public link, and giving "401: no authorization " error when calling the API.
Anyone knows why this happened?
The public
Thanks Sebastain and Arley,
After i added following setting in my package.json, problem solved.
Please note, i repeat the setting twice, because the "production" configuration is called when project deployed and run on cloud foundry.
name:"myapp",
version:"1.0.0"
....
cds:{
.....
require:
"auth":{
"kind":"xsuaa",
"restrict_all_services":false
},
"[production]":{
auth:{
"kind:"xsuaa",
"restrict_all_services":false
}
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
9 | |
8 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.