@Test
        void verifyX509ClientCredentialsFailsToPassIP() throws Throwable {
            val service = getRegisteredService(OAuth20GrantTypes.CLIENT_CREDENTIALS);
            service.setJwtAccessToken(true);
            service.setTokenEndpointAuthenticationMethod(OAuth20ClientAuthenticationMethods.TLS_CLIENT_AUTH.getType());
            service.setTlsClientAuthSanIp("1.2.3.4");
            servicesManager.save(service);
            val certificate = CertUtils.readCertificate(new ClassPathResource("RSA1024x509Cert.pem").getInputStream());
            mvc.perform(post("/cas" + CONTEXT + OAuth20Constants.ACCESS_TOKEN_URL)
                    .queryParam(OAuth20Constants.CLIENT_ID, service.getClientId())
                    .queryParam(OAuth20Constants.GRANT_TYPE, OAuth20GrantTypes.CLIENT_CREDENTIALS.name())
                    .requestAttr("jakarta.servlet.request.X509Certificate", new X509Certificate[]{certificate}))
                .andExpect(status().isUnauthorized())
                .andExpect(jsonPath("$.access_token").doesNotExist());
        }
This class tests the {@link OAuth20AccessTokenEndpointController} class.

@author Jerome Leleu
@since 3.5.2
support/cas-server-support-oauth/src/test/java/org/apereo/cas/support/oauth/web/endpoints/OAuth20AccessTokenEndpointControllerTests.java