protected CasSimpleMultifactorAuthenticationTicket createAndStoreToken(final Service givenService,
                                                                           final Authentication authentication) throws Throwable {
        val principal = authentication.getPrincipal();
        val mfaService = applicationContext.getBean(CasSimpleMultifactorAuthenticationService.BEAN_NAME, CasSimpleMultifactorAuthenticationService.class);
        val token = mfaService.generate(principal, givenService);
        mfaService.store(token);
        return token;
    }
Generate token and produce response entity.

@param service       the service
@param authorization the authorization
@return the response entity
support/cas-server-support-simple-mfa-core/src/main/java/org/apereo/cas/mfa/simple/web/CasSimpleMultifactorAuthenticationEndpoint.java