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 java.lang.Object implements org.springframework.http.converter.HttpMessageConverter<RelyingPartyRegistration.Builder>
AnHttpMessageConverter
that takes anIDPSSODescriptor
in an HTTP response and converts it into aRelyingPartyRegistration.Builder
. The primary use case for this is constructing aRelyingPartyRegistration
for inclusion in aRelyingPartyRegistrationRepository
. To do so, you can include an instance of this converter in aRestOperations
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 theRelyingPartyRegistration
, meaning where and how to send AuthnRequests, how to verify Assertions, etc. To further configure theRelyingPartyRegistration
with relying party (SP) information, you may invoke the appropriate methods on the builder.- Since:
- 5.4
-
-
Constructor Summary
Constructors Constructor Description OpenSamlRelyingPartyRegistrationBuilderHttpMessageConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canRead(java.lang.Class<?> clazz, org.springframework.http.MediaType mediaType)
boolean
canWrite(java.lang.Class<?> clazz, org.springframework.http.MediaType mediaType)
java.util.List<org.springframework.http.MediaType>
getSupportedMediaTypes()
RelyingPartyRegistration.Builder
read(java.lang.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)
-
-
-
Method Detail
-
canRead
public boolean canRead(java.lang.Class<?> clazz, org.springframework.http.MediaType mediaType)
- Specified by:
canRead
in interfaceorg.springframework.http.converter.HttpMessageConverter<RelyingPartyRegistration.Builder>
-
canWrite
public boolean canWrite(java.lang.Class<?> clazz, org.springframework.http.MediaType mediaType)
- Specified by:
canWrite
in interfaceorg.springframework.http.converter.HttpMessageConverter<RelyingPartyRegistration.Builder>
-
getSupportedMediaTypes
public java.util.List<org.springframework.http.MediaType> getSupportedMediaTypes()
- Specified by:
getSupportedMediaTypes
in interfaceorg.springframework.http.converter.HttpMessageConverter<RelyingPartyRegistration.Builder>
-
read
public RelyingPartyRegistration.Builder read(java.lang.Class<? extends RelyingPartyRegistration.Builder> clazz, org.springframework.http.HttpInputMessage inputMessage) throws java.io.IOException, org.springframework.http.converter.HttpMessageNotReadableException
- Specified by:
read
in interfaceorg.springframework.http.converter.HttpMessageConverter<RelyingPartyRegistration.Builder>
- Throws:
java.io.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
-
-