@GetMapping(path = BASE_ENDPOINT_SERVICE_PROVIDER + "/{client}/idp/metadata", consumes = MediaType.ALL_VALUE,
        produces = MediaType.APPLICATION_XML_VALUE)
    @Operation(summary = "Get identity provider metadata by name",
        parameters = @Parameter(name = "client", in = ParameterIn.PATH, required = true, description = "The client name"))
    public ResponseEntity<String> getIdentityProviderMetadataByName(
        @PathVariable("client")
        final String client,
        final HttpServletRequest request, final HttpServletResponse response) {
        val webContext = new JEEContext(request, response);
        val saml2Client = identityProviders.findClient(client, webContext);
        return saml2Client.map(value -> getSaml2ClientIdentityProviderMetadataResponseEntity((SAML2Client) value))
            .orElseGet(DelegatedSaml2ClientMetadataController::getNotAcceptableResponseEntity);
    }
Gets idp metadata by name.

@param client the client
@return the service provider metadata by name
support/cas-server-support-pac4j-saml/src/main/java/org/apereo/cas/web/saml2/DelegatedSaml2ClientMetadataController.java