Source:
<code>private List<ClientRegistration> getClientRegistrations(Element element, ParserContext parserContext, Map<String, Map<String, String>> providers) { List<Element> clientRegistrationElts = DomUtils.getChildElementsByTagName(element, ELT_CLIENT_REGISTRATION); List<ClientRegistration> clientRegistrations = new ArrayList<>(); for (Element clientRegistrationElt : clientRegistrationElts) { String registrationId = clientRegistrationElt.getAttribute(ATT_REGISTRATION_ID); String providerId = clientRegistrationElt.getAttribute(ATT_PROVIDER_ID); ClientRegistration.Builder builder = getBuilderFromIssuerIfPossible(registrationId, providerId, providers); if (builder == null) { builder = getBuilder(registrationId, providerId, providers); if (builder == null) { Object source = parserContext.extractSource(element); parserContext.getReaderContext().error(getErrorMessage(providerId, registrationId), source); continue; } } getOptionalIfNotEmpty(clientRegistrationElt.getAttribute(ATT_CLIENT_ID)) <START> .map(parserContext.getReaderContext().getEnvironment()::resolvePlaceholders) <END> .ifPresent(builder::clientId); getOptionalIfNotEmpty(clientRegistrationElt.getAttribute(ATT_CLIENT_SECRET)) .map(parserContext.getReaderContext().getEnvironment()::resolvePlaceholders) .ifPresent(builder::clientSecret); getOptionalIfNotEmpty(clientRegistrationElt.getAttribute(ATT_CLIENT_AUTHENTICATION_METHOD)) .map(ClientAuthenticationMethod::new) .ifPresent(builder::clientAuthenticationMethod); getOptionalIfNotEmpty(clientRegistrationElt.getAttribute(ATT_AUTHORIZATION_GRANT_TYPE)) .map(AuthorizationGrantType::new) .ifPresent(builder::authorizationGrantType); getOptionalIfNotEmpty(clientRegistrationElt.getAttribute(ATT_REDIRECT_URI)) .ifPresent(builder::redirectUriTemplate); getOptionalIfNotEmpty(clientRegistrationElt.getAttribute(ATT_SCOPE)) .map(StringUtils::commaDelimitedListToSet) .ifPresent(builder::scope); getOptionalIfNotEmpty(clientRegistrationElt.getAttribute(ATT_CLIENT_NAME)) .ifPresent(builder::clientName); clientRegistrations.add(builder.build()); } return clientRegistrations; }</code><technical_language>right @evgeniycheban - ClientRegistration beans work. > move parserContext.getReaderContext().getEnvironment()::resolvePlaceholders getOptionalIfNotEmpty method? Agreed</technical_language>

Target:
private List<ClientRegistration> getClientRegistrations(Element element, ParserContext parserContext, Map<String, Map<String, String>> providers) { List<Element> clientRegistrationElts = DomUtils.getChildElementsByTagName(element, ELT_CLIENT_REGISTRATION); List<ClientRegistration> clientRegistrations = new ArrayList<>(); for (Element clientRegistrationElt : clientRegistrationElts) { String registrationId = clientRegistrationElt.getAttribute(ATT_REGISTRATION_ID); String providerId = clientRegistrationElt.getAttribute(ATT_PROVIDER_ID); ClientRegistration.Builder builder = getBuilderFromIssuerIfPossible(parserContext, registrationId, providerId, providers); if (builder == null) { builder = getBuilder(parserContext, registrationId, providerId, providers); if (builder == null) { Object source = parserContext.extractSource(element); parserContext.getReaderContext().error(getErrorMessage(providerId, registrationId), source); continue; } } getOptionalIfNotEmpty(parserContext, clientRegistrationElt.getAttribute(ATT_CLIENT_ID)) .ifPresent(builder::clientId); getOptionalIfNotEmpty(parserContext, clientRegistrationElt.getAttribute(ATT_CLIENT_SECRET)) .ifPresent(builder::clientSecret); getOptionalIfNotEmpty(parserContext, clientRegistrationElt.getAttribute(ATT_CLIENT_AUTHENTICATION_METHOD)) .map(ClientAuthenticationMethod::new).ifPresent(builder::clientAuthenticationMethod); getOptionalIfNotEmpty(parserContext, clientRegistrationElt.getAttribute(ATT_AUTHORIZATION_GRANT_TYPE)) .map(AuthorizationGrantType::new).ifPresent(builder::authorizationGrantType); getOptionalIfNotEmpty(parserContext, clientRegistrationElt.getAttribute(ATT_REDIRECT_URI)) .ifPresent(builder::redirectUri); getOptionalIfNotEmpty(parserContext, clientRegistrationElt.getAttribute(ATT_SCOPE)) .map(StringUtils::commaDelimitedListToSet).ifPresent(builder::scope); getOptionalIfNotEmpty(parserContext, clientRegistrationElt.getAttribute(ATT_CLIENT_NAME)) .ifPresent(builder::clientName); clientRegistrations.add(builder.build()); } return clientRegistrations; }