@Test
    void verifyForceAuthnWhenSsoDisabled() throws Throwable {
        val requestContext = MockRequestContext.create(applicationContext);
        val httpServletResponse = requestContext.getHttpServletResponse();
        val httpServletRequest = requestContext.getHttpServletRequest();
        val service = RegisteredServiceTestUtils.getService(UUID.randomUUID().toString());
        requestContext.setParameter(CasProtocolConstants.PARAMETER_SERVICE, service.getId());

        val registeredService = RegisteredServiceTestUtils.getRegisteredService(service.getId());
        registeredService.setAccessStrategy(new DefaultRegisteredServiceAccessStrategy().setSsoEnabled(false));
        servicesManager.save(registeredService);

        val context = new JEEContext(httpServletRequest, httpServletResponse);

        val client = identityProviders.findClient("CasClient", context).orElseThrow();
        val details = contributor.store(requestContext, context, client);
        assertTrue(details.containsKey(CasProtocolConstants.PARAMETER_SERVICE));
        assertTrue(details.containsKey(CasProtocolConstants.PARAMETER_TARGET_SERVICE));
        assertTrue(details.containsKey(Client.class.getName()));
        assertTrue(details.containsKey(RedirectionActionBuilder.ATTRIBUTE_FORCE_AUTHN));
    }
This is {@link DefaultDelegatedClientAuthenticationWebflowStateContributorTests}.

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