I’m doing a test where I’m switching Sonar from LDAP to SAML, however SAML authentication is not working and it’s driving me crazy
The error i’m getting is: DEBUG web[AZHW/vlus4sveQHZAADF][auth.event] login failure [cause|CSRF state value is invalid][method|OAUTH2][provider|EXTERNAL|SSO_test][IP|10.175.5.55|][login|]
In web.log I can see Sonar receiving and parsing the response from the provider (it even says “SAMLResponse validated”) and I can see correctly populated attributes.
Relevant details:
Sonar version: 9.9.4
At first I was using Nginx as a reverse proxy; after removing it (and re-configuring the provider) the end results was the same…
After numerous attempts, something strange happened — just once, and only once, the error changed to Cookie ‘OAUTHSTATE’ is missing — now that was an error I recognized.
After tweaking the identity provider to enable service-initiated SSO, I was finally able to log in successfully!
What was odd, though, was that 99% of the time, I kept encountering the same ambiguous “CSRF state value is invalid” error. I was lucky that, in the end, the real issue revealed itself!