Skip to content

jwk_uri property is now mandatory in v1.12.1, breaking backward compatibility #3054

@ysknkd

Description

@ysknkd

It appears that since version v1.12.1, the jwk_uri property has become a mandatory requirement. As a result, AuthZpeClient can no longer be used if this property is not configured.

To the best of my knowledge, in v1.11.x, this property was not required for AuthZpeClient to function. This change in behavior introduces a backward compatibility issue.

String serverUrl = System.getProperty(ZpeConsts.ZPE_PROP_JWK_URI);
if (serverUrl == null || serverUrl.isEmpty()) {
throw new IllegalArgumentException("Missing required property: " + ZpeConsts.ZPE_PROP_JWK_URI);
}

Would it be possible to consider modifying the logic? For instance, with a change like the following:

    public static void initializeAccessTokenSignKeyResolver() {
        final String keyPath = System.getProperty(ZpeConsts.ZPE_PROP_JWK_PRIVATE_KEY_PATH);
        final String certPath = System.getProperty(ZpeConsts.ZPE_PROP_JWK_X509_CERT_PATH);
        SSLContext sslContext = null;
        if (keyPath != null && !keyPath.isEmpty() && certPath != null && !certPath.isEmpty()) {
            try {
                KeyRefresher keyRefresher = Utils.generateKeyRefresher(null, certPath, keyPath);
                keyRefresher.startup();
                sslContext = Utils.buildSSLContext(keyRefresher.getKeyManagerProxy(),
                        keyRefresher.getTrustManagerProxy());
            } catch (Exception ex) {
                LOG.error("Unable to initialize key refresher: {}", ex.getMessage());
            }
        }

        // 
        // setAccessTokenSignKeyResolver should only be executed when jwk_uri is configured.
        // 
        String serverUrl = System.getProperty(ZpeConsts.ZPE_PROP_JWK_URI);
        if (serverUrl != null && !serverUrl.isEmpty()) {
            setAccessTokenSignKeyResolver(serverUrl, sslContext);
            setMillisBetweenZtsCalls(Long.parseLong(System.getProperty(ZPE_PROP_MILLIS_BETWEEN_ZTS_CALLS, Long.toString(30 * 1000 * 60))));
        }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions