zitadel/internal/idp/providers
Stuart Douglas 81920e599b
fix(SAML): log underlying error if SAML response validation fails (#8721)
# Which Problems Are Solved

If SAML response validation in crewjam/saml fails, a generic
"Authentication failed" error is thrown. This makes it challenging to
determine the actual cause, since there are a variety of reasons
response validation may fail.

# How the Problems Are Solved

Add a log statement if we receive a response validation error from
crewjam/saml that logs the internal `InvalidResponseError.PrivateErr`
error from crewjam/saml to stdout. We continue to return a generic error
message to the client to prevent leaking data.

Verified by running `go test -v ./internal/idp/providers/saml` in
verbose mode, which output the following line for the "response_invalid"
test case:
```
time="2024-10-03T14:53:10+01:00" level=info msg="invalid SAML response details" caller="/Users/sdouglas/Documents/thirdparty-repos/zitadel/internal/idp/providers/saml/session.go:72" error="cannot parse base64: illegal base64 data at input byte 2"
```

# Additional Changes

None

# Additional Context

- closes #8717

---------

Co-authored-by: Stuart Douglas <sdouglas@hopper.com>
2024-10-11 07:04:15 +00:00
..
apple fix: improve secret generation for apple idp (#7843) 2024-04-26 15:46:15 +00:00
azuread fix(idp): provide id_token for tenant id based azure ad (#7188) 2024-01-10 15:02:17 +00:00
github merge main into next 2023-10-19 12:34:00 +02:00
gitlab merge main into next 2023-10-19 12:34:00 +02:00
google merge main into next 2023-10-19 12:34:00 +02:00
jwt chore(deps): update all go deps (#7773) 2024-04-15 09:17:36 +00:00
ldap fix: encode ldap values to make valid UTF8 (#8210) 2024-06-28 13:46:54 +00:00
oauth fix: improve login_hint usage on IDPs (#6899) 2023-11-13 09:25:26 +01:00
oidc chore(deps): update all go deps (#7773) 2024-04-15 09:17:36 +00:00
saml fix(SAML): log underlying error if SAML response validation fails (#8721) 2024-10-11 07:04:15 +00:00