@Test
        void verifyClientNameFromAuth() throws Throwable {
            val requestContext = MockRequestContext.create(applicationContext);
            val webContext = new JEEContext(requestContext.getHttpServletRequest(), requestContext.getHttpServletResponse());

            val client = identityProviders.findClient("CasClient", webContext).orElseThrow();
            val authn = RegisteredServiceTestUtils.getAuthentication("casuser",
                Map.of(ClientCredential.AUTHENTICATION_ATTRIBUTE_CLIENT_NAME, List.of(client.getName())));

            val service = RegisteredServiceTestUtils.getService(UUID.randomUUID().toString());
            val accessStrategy = new DefaultRegisteredServiceAccessStrategy();
            val delegationStrategy = new DefaultRegisteredServiceDelegatedAuthenticationPolicy()
                .setAllowedProviders(List.of(client.getName()));
            accessStrategy.setDelegatedAuthenticationPolicy(delegationStrategy);
            val registeredService = RegisteredServiceTestUtils.getRegisteredService(service.getId(), Map.of());
            registeredService.setAccessStrategy(accessStrategy);
            servicesManager.save(registeredService);
            assertTrue(delegatedClientIdentityProviderAuthorizer.isDelegatedClientAuthorizedForAuthentication(authn, service, requestContext));
        }
This is {@link DefaultDelegatedClientIdentityProviderAuthorizerTests}.

@author Misagh Moayyed
@since 6.6.0
support/cas-server-support-pac4j-webflow/src/test/java/org/apereo/cas/web/flow/authz/DefaultDelegatedClientIdentityProviderAuthorizerTests.java