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>
AnHttpMessageConverterthat takes anIDPSSODescriptorin an HTTP response and converts it into aRelyingPartyRegistration.Builder. The primary use case for this is constructing aRelyingPartyRegistrationfor inclusion in aRelyingPartyRegistrationRepository. To do so, you can include an instance of this converter in aRestOperationslike 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 theRelyingPartyRegistrationwith 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 booleancanRead(java.lang.Class<?> clazz, org.springframework.http.MediaType mediaType)booleancanWrite(java.lang.Class<?> clazz, org.springframework.http.MediaType mediaType)java.util.List<org.springframework.http.MediaType>getSupportedMediaTypes()RelyingPartyRegistration.Builderread(java.lang.Class<? extends RelyingPartyRegistration.Builder> clazz, org.springframework.http.HttpInputMessage inputMessage)voidwrite(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:
canReadin interfaceorg.springframework.http.converter.HttpMessageConverter<RelyingPartyRegistration.Builder>
-
canWrite
public boolean canWrite(java.lang.Class<?> clazz, org.springframework.http.MediaType mediaType)- Specified by:
canWritein interfaceorg.springframework.http.converter.HttpMessageConverter<RelyingPartyRegistration.Builder>
-
getSupportedMediaTypes
public java.util.List<org.springframework.http.MediaType> getSupportedMediaTypes()
- Specified by:
getSupportedMediaTypesin 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:
readin interfaceorg.springframework.http.converter.HttpMessageConverter<RelyingPartyRegistration.Builder>- Throws:
java.io.IOExceptionorg.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:
writein interfaceorg.springframework.http.converter.HttpMessageConverter<RelyingPartyRegistration.Builder>- Throws:
org.springframework.http.converter.HttpMessageNotWritableException
-
-