mace-opensaml-users - Re: [OpenSAML] Verifying SAML signed metadata files
Subject: OpenSAML user discussion
List archive
- From: Brent Putman <>
- To:
- Subject: Re: [OpenSAML] Verifying SAML signed metadata files
- Date: Mon, 28 Apr 2008 19:21:37 -0400
Paolo Selvini wrote:
The MetadataProvider impls drop the cached DOM after the provider is initialized in order to save memory. On the signature element, this also includes dropping the Apache XMLSignature object which has been cached from unmarshalling. Both would be necessary to validate the signature. In your case I think the ValidationException is getting getting (correctly) thrown by the SAMLSignatureProfileValidator, because the Apache XMLSignature instance is unavailable.
Yeah, the same thing would happen with the other provider. So because of this, you can't really validate the signature on the metadata by pulling the root object off and processing it, nor anything else that requires access to the cached DOM elements of the tree, such as DOM-level schema validation. This is the expected behavior.
The correct approach is to use a MetadataFilter. See the SignatureValidationFilter in the saml2.metadata.provider package. This requires the use of a SignatureTrustEngine, which is a higher-level API than the low-level SignatureValidator. To replicate what you currently do (validate against a known key/cert trusted explictly in advance), just use an ExplicitKeySignatureTrustEngine, built with a StaticCredentialResolver containing your trusted keys/cert(s). After building the filter, you'll just add to the provider with setMetadataFilter *before* you call fsmd.initialize(). If if fails validation, you'll get a FilterException. For examples of how to build the filter, see also the SignatureValidationFilterTest in src\test\resources\data\org\opensaml\saml2\metadata\provider. --Brent |
- Reading signed metadata, Paolo Selvini, 04/22/2008
- Re: [OpenSAML] Reading signed metadata, Chad La Joie, 04/22/2008
- Re: [OpenSAML] Reading signed metadata, Brent Putman, 04/22/2008
- Verifying SAML signed metadata files, Paolo Selvini, 04/28/2008
- Re: [OpenSAML] Verifying SAML signed metadata files, Brent Putman, 04/28/2008
- Verifying SAML signed metadata files, Paolo Selvini, 04/28/2008
Archive powered by MHonArc 2.6.16.