zitadel/internal/api/grpc
Livio Spring 35df5f61fc
fix(saml): improve error handling (#8928)
# Which Problems Are Solved

There are multiple issues with the metadata and error handling of SAML:
- When providing a SAML metadata for an IdP, which cannot be processed,
the error will only be noticed once a user tries to use the IdP.
- Parsing for metadata with any other encoding than UTF-8 fails.
- Metadata containing an enclosing EntitiesDescriptor around
EntityDescriptor cannot be parsed.
- Metadata's `validUntil` value is always set to 48 hours, which causes
issues on external providers, if processed from a manual down/upload.
- If a SAML response cannot be parsed, only a generic "Authentication
failed" error is returned, the cause is hidden to the user and also to
actions.

# How the Problems Are Solved

- Return parsing errors after create / update and retrieval of an IdP in
the API.
- Prevent the creation and update of an IdP in case of a parsing
failure.
- Added decoders for encodings other than UTF-8 (including ASCII,
windows and ISO, [currently
supported](efd25daf28/encoding/ianaindex/ianaindex.go (L156)))
- Updated parsing to handle both `EntitiesDescriptor` and
`EntityDescriptor` as root element
- `validUntil` will automatically set to the certificate's expiration
time
- Unwrapped the hidden error to be returned. The Login UI will still
only provide a mostly generic error, but action can now access the
underlying error.

# Additional Changes

None

# Additional Context

reported by a customer

(cherry picked from commit ffe9570776)
2024-12-03 11:42:58 +01:00
..
action feat(v3alpha): write actions (#8225) 2024-07-31 14:42:12 +02:00
admin fix(saml): improve error handling (#8928) 2024-12-03 11:42:58 +01:00
auth fix: user grants deactivation (#8634) 2024-09-17 12:18:29 +00:00
authn chore(v2): move to new org (#3499) 2022-04-26 23:01:45 +00:00
change refactor(fmt): run gci on complete project (#7557) 2024-04-03 10:43:43 +00:00
client/middleware refactor(fmt): run gci on complete project (#7557) 2024-04-03 10:43:43 +00:00
event refactor: rename package errors to zerrors (#7039) 2023-12-08 15:30:55 +01:00
feature feat(OIDC): add back channel logout (#8837) 2024-10-31 15:57:17 +01:00
gerrors fix: exclude db connection error details (#7785) 2024-04-23 08:35:25 +00:00
idp chore: improve integration tests (#8727) 2024-10-17 21:20:57 +00:00
instance feat: trusted (instance) domains (#8369) 2024-07-31 18:00:38 +03:00
management fix(saml): improve error handling (#8928) 2024-12-03 11:42:58 +01:00
member refactor: cleanup unused code (#7130) 2024-01-02 14:26:31 +00:00
metadata fix(api): correct mapping of metadata queries (#7609) 2024-03-21 14:56:58 +00:00
object feat: api v2beta to api v2 (#8283) 2024-07-26 22:39:55 +02:00
oidc chore: add await for project to oidc integration tests (#8809) 2024-10-23 07:36:50 +00:00
org fix: correctly search for verified domain (#8820) 2024-10-25 17:51:44 +02:00
policy feat(cnsl): docs link can be customized and custom button is available (#7840) 2024-05-13 16:01:50 +02:00
project feat(OIDC): add back channel logout (#8837) 2024-10-31 15:57:17 +01:00
resources chore: remove some integration test flakiness (#8818) 2024-10-31 15:34:20 +00:00
server chore(tests): use a coverage server binary (#8407) 2024-09-06 14:47:57 +02:00
session chore: improve integration tests (#8727) 2024-10-17 21:20:57 +00:00
settings chore: correct require usage to assert for eventual consistency (#8795) 2024-10-21 19:15:02 +00:00
system chore: improve integration tests (#8727) 2024-10-17 21:20:57 +00:00
text fix: automatically link user without prompt (#8487) 2024-08-28 05:33:20 +00:00
user chore: add await for project to oidc integration tests (#8809) 2024-10-23 07:36:50 +00:00
config.go remove pointers on configs 2020-03-27 13:57:16 +01:00
fields.go chore(tests): use a coverage server binary (#8407) 2024-09-06 14:47:57 +02:00
header_test.go remove negated integration tags 2023-04-26 19:55:13 +03:00
header.go chore(v2): move to new org (#3499) 2022-04-26 23:01:45 +00:00
probes_test.go add server reflection to Probes list 2023-05-07 16:47:43 +02:00
probes.go add server reflection to Probes list 2023-05-07 16:47:43 +02:00