-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Closed
Labels
Milestone
Description
Describe the bug
Saml metadata is corrupted once it contains special characters.
To Reproduce
- Configure the metadata to contain special characters, e.g. via OpenSamlMetadataResolver.EntityDescriptorParameters.
- Generate the metadata via /saml2/service-provider-metadata/{descriptor}
- The metadata is corrupted and invalid xml
Expected behavior
The metadata is not corrupted, valid xml and obeys the Saml Standard
Cause
In Saml2MetadataFilter Line 111
response.setContentLength(metadata.getMetadata().length());
is generally wrong as the length in bytes is required which differs from Java String length, e.g. "ä".length() = 1 but should be 2