@Override
    public void configure(String encodedAuthParamString) {
        checkArgument(isNotBlank(encodedAuthParamString), "authParams must not be empty");

        try {
            setAuthParams(AuthenticationUtil.configureFromJsonString(encodedAuthParamString));
        } catch (IOException e) {
            throw new IllegalArgumentException("Failed to parse authParams", e);
        }
    }
@Test
    public void testCopperArgos() throws Exception {
        @Cleanup
        AuthenticationAthenz caAuth = new AuthenticationAthenz();
        Field ztsClientField = caAuth.getClass().getDeclaredField("ztsClient");
        ztsClientField.setAccessible(true);
        ztsClientField.set(caAuth, new MockZTSClient("dummy"));

        ObjectMapper jsonMapper = ObjectMapperFactory.create();
        Map<String, String> authParamsMap = new HashMap<>();
        authParamsMap.put("providerDomain", "test_provider");
        authParamsMap.put("ztsUrl", "https://localhost:4443/");

        try {
            caAuth.configure(jsonMapper.writeValueAsString(authParamsMap));
            fail("Should not succeed if some required parameters are missing");
        } catch (Exception e) {
            assertTrue(e instanceof IllegalArgumentException);
        }

        authParamsMap.put("x509CertChain", "data:application/x-pem-file;base64,aW52YWxpZAo=");
        try {
            caAuth.configure(jsonMapper.writeValueAsString(authParamsMap));
            fail("'data' scheme url should not be accepted");
        } catch (Exception e) {
            assertTrue(e instanceof IllegalArgumentException);
        }

        authParamsMap.put("x509CertChain", "file:./src/test/resources/copper_argos_client.crt");
        try {
            caAuth.configure(jsonMapper.writeValueAsString(authParamsMap));
            fail("Should not succeed if 'privateKey' or 'caCert' is missing");
        } catch (Exception e) {
            assertTrue(e instanceof IllegalArgumentException);
        }

        authParamsMap.put("privateKey", "./src/test/resources/copper_argos_client.key");
        authParamsMap.put("caCert", "./src/test/resources/copper_argos_ca.crt");
        caAuth.configure(jsonMapper.writeValueAsString(authParamsMap));

        Field x509CertChainPathField = caAuth.getClass().getDeclaredField("x509CertChainPath");
        x509CertChainPathField.setAccessible(true);
        String actualX509CertChainPath = (String) x509CertChainPathField.get(caAuth);
        assertFalse(actualX509CertChainPath.startsWith("file:"));
        assertFalse(actualX509CertChainPath.startsWith("./"));
        assertTrue(actualX509CertChainPath.endsWith("/src/test/resources/copper_argos_client.crt"));

        Field privateKeyPathField = caAuth.getClass().getDeclaredField("privateKeyPath");
        privateKeyPathField.setAccessible(true);
        String actualPrivateKeyPath = (String) privateKeyPathField.get(caAuth);
        assertFalse(actualPrivateKeyPath.startsWith("file:"));
        assertFalse(actualPrivateKeyPath.startsWith("./"));
        assertTrue(actualPrivateKeyPath.endsWith("/src/test/resources/copper_argos_client.key"));

        Field caCertPathField = caAuth.getClass().getDeclaredField("caCertPath");
        caCertPathField.setAccessible(true);
        String actualCaCertPath = (String) caCertPathField.get(caAuth);
        assertFalse(actualCaCertPath.startsWith("file:"));
        assertFalse(actualCaCertPath.startsWith("./"));
        assertTrue(actualCaCertPath.endsWith("/src/test/resources/copper_argos_ca.crt"));
    }