Class OpenSamlRelyingPartyRegistrationBuilderHttpMessageConverter
java.lang.Object
org.springframework.security.saml2.provider.service.registration.OpenSamlRelyingPartyRegistrationBuilderHttpMessageConverter
- All Implemented Interfaces:
org.springframework.http.converter.HttpMessageConverter<RelyingPartyRegistration.Builder>
public class OpenSamlRelyingPartyRegistrationBuilderHttpMessageConverter
extends Object
implements org.springframework.http.converter.HttpMessageConverter<RelyingPartyRegistration.Builder>
An
HttpMessageConverter
that takes an IDPSSODescriptor
in an HTTP
response and converts it into a RelyingPartyRegistration.Builder
.
The primary use case for this is constructing a RelyingPartyRegistration
for
inclusion in a RelyingPartyRegistrationRepository
. To do so, you can include an
instance of this converter in a RestOperations
like so:
RestOperations rest = new RestTemplate(Collections.singletonList( new RelyingPartyRegistrationsBuilderHttpMessageConverter())); RelyingPartyRegistration.Builder builder = rest.getForObject ("https://idp.example.org/metadata", RelyingPartyRegistration.Builder.class); RelyingPartyRegistration registration = builder.registrationId("registration-id").build();Note that this will only configure the asserting party (IDP) half of the
RelyingPartyRegistration
, meaning where and how to send AuthnRequests, how to
verify Assertions, etc.
To further configure the RelyingPartyRegistration
with relying party (SP)
information, you may invoke the appropriate methods on the builder.- Since:
- 5.4
-
Constructor Summary
ConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
List<org.springframework.http.MediaType>
read
(Class<? extends RelyingPartyRegistration.Builder> clazz, org.springframework.http.HttpInputMessage inputMessage) void
write
(RelyingPartyRegistration.Builder builder, org.springframework.http.MediaType contentType, org.springframework.http.HttpOutputMessage outputMessage) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.http.converter.HttpMessageConverter
getSupportedMediaTypes
-
Constructor Details
-
OpenSamlRelyingPartyRegistrationBuilderHttpMessageConverter
public OpenSamlRelyingPartyRegistrationBuilderHttpMessageConverter()
-
-
Method Details
-
canRead
- Specified by:
canRead
in interfaceorg.springframework.http.converter.HttpMessageConverter<RelyingPartyRegistration.Builder>
-
canWrite
- Specified by:
canWrite
in interfaceorg.springframework.http.converter.HttpMessageConverter<RelyingPartyRegistration.Builder>
-
getSupportedMediaTypes
- Specified by:
getSupportedMediaTypes
in interfaceorg.springframework.http.converter.HttpMessageConverter<RelyingPartyRegistration.Builder>
-
read
public RelyingPartyRegistration.Builder read(Class<? extends RelyingPartyRegistration.Builder> clazz, org.springframework.http.HttpInputMessage inputMessage) throws IOException, org.springframework.http.converter.HttpMessageNotReadableException - Specified by:
read
in interfaceorg.springframework.http.converter.HttpMessageConverter<RelyingPartyRegistration.Builder>
- Throws:
IOException
org.springframework.http.converter.HttpMessageNotReadableException
-
write
public void write(RelyingPartyRegistration.Builder builder, org.springframework.http.MediaType contentType, org.springframework.http.HttpOutputMessage outputMessage) throws org.springframework.http.converter.HttpMessageNotWritableException - Specified by:
write
in interfaceorg.springframework.http.converter.HttpMessageConverter<RelyingPartyRegistration.Builder>
- Throws:
org.springframework.http.converter.HttpMessageNotWritableException
-