I am able to do SAML based authentication for a single URL of the application. IDP login is redirected and login is successful. But unable to generalize for all API.
But when I try to add auth_reqeust and generalize for all APIs I am getting "auth request unexpected status: 302 while sending to client, client" error
server {
listen 0.0.0.0:8443 default ssl;
...........
..........
auth_request /saml;
location /saml{
proxy_pass http://172.19.167.213:9180/simplesaml/saml2/idp/SSOService.php?spentityid=https://172.19.167.213/;
}
location /enrollment/saml/callback {
proxy_pass http://localhost:8093/saml/callback;
return 302 https://172.19.167.213/;
}
}
I have my IDP running on http://172.19.167.213:9180/simplesaml
Home page for protected application:- https://172.19.167.213/;
Error details from logs:-
2022/07/18 07:15:28 [error] 3511#3511: *12 auth request unexpected status: 302 while sending to client, client: 172.19.160.1, server: , request: "GET / HTTP/1.1", host: "172.19.167.213", referrer: "http://172.19.167.213:9180/"
2022/07/18 07:15:28 [error] 3511#3511: *12 auth request unexpected status: 302 while sending to client, client: 172.19.160.1, server: , request: "GET / HTTP/1.1", host: "172.19.167.213", referrer: "http://172.19.167.213:9180/"
172.19.160.1 - - [18/Jul/2022:07:15:28 +0000] "GET / HTTP/1.1" 500 576 "http://172.19.167.213:9180/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"