@Override
    protected OIDCProviderMetadata retrieveMetadata() {
        try (val in = SpringResourceHelper.getResourceInputStream(
            resource,
            null,
            configuration.getSslSocketFactory(),
            configuration.getHostnameVerifier(),
            configuration.getConnectTimeout(),
            configuration.getReadTimeout()
        )) {
            String metadata = IOUtils.readInputStreamToString(in);
            // When using the tenantid "common" an invalid issuer URL is returned containing {}
            // ULR encode the invalid characters so it wont break the azure flow
            metadata = metadata.replace("{tenantid}", "%7Btenantid%7D");
            return OIDCProviderMetadata.parse(metadata);
        } catch (final IOException | ParseException e) {
            throw new OidcException("Error getting OP metadata", e);
        }
    }
<p>Constructor for AzureAdOpMetadataResolver.</p>

@param configuration a {@link OidcConfiguration} object
pac4j-oidc/src/main/java/org/pac4j/oidc/metadata/AzureAdOpMetadataResolver.java