I have the following setup: A Spring-Boot web server with ADFS Single Sign-on over SAML which I based on this project https://github.com/isaacgarza/saml-example instead of Maven I’m using Gradle if that matters.
The Login and normal functionality are working just fine. except a CORS Error with one of two Error messages in the Browser:
- case one
- case two
and always the same Error in Spring
2021-09-02 09:48:25.042 DEBUG 80412 --- [io-10009-exec-5] o.a.tomcat.util.net.jsse.JSSESupport : Error trying to obtain a certificate from the client
javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
at java.base/sun.security.ssl.SSLSessionImpl.getPeerCertificates(SSLSessionImpl.java:556) ~[na:na]
at org.apache.tomcat.util.net.jsse.JSSESupport.getPeerCertificateChain(JSSESupport.java:106) ~[tomcat-embed-core-9.0.41.jar:9.0.41]
I have tried a dozen variants of CORS implementations with @CrossOrigin and Global CORS configutation but none of my implementations leads to the desired behavior.
I send a Get-Request to my Spring-Server and instead of processing this Get-Request the Spring-Server redirects this to the ADFS and now the error message occurs because ADFS can’t handle this – naturally.
Question: How can I prevent this redirecting of the Get-Request (of the Spring-Server) to the ADFS?
I appreciate any hints or code chunks and when any additional information is needed let me know – I will edit my post. Many thanks in advance!