cancel
Showing results for 
Search instead for 
Did you mean: 

CAP JAVA: CDS service with $batch requires authentication

christoffer_fuss
Participant
0 Kudos

Hello,

I have a CAP JAVA application where I defined a service with public entities and protected entities with requires annotation like this:

christoffer_fuss_0-1709628385428.png
I can consume all my public entities without authentication. 
But the $batch request gives a 401 error and requires authentication.
How can I make the $batch public as well with requires annotation?
I tried with spring security config:

christoffer_fuss_1-1709628754589.png

This makes the $batch public but then I cannot get the authentication info of logged in users, so 

userInfo.isAuthenticated() is always false (also for logged in users).

christoffer_fuss_2-1709629147112.png

What is the best way to solve this?

Best regards and many thanks,

Chris

 

 

 

Accepted Solutions (0)

Answers (0)