@GetMapping(produces = MediaType.APPLICATION_JSON_VALUE)
    @Operation(summary = "Generate simple multifactor authentication token",
        parameters = {
            @Parameter(name = "credential", required = true, description = "Credential header in base64 encoding to carry the user"),
            @Parameter(name = "service", required = true, description = "The target service url for which the token should be issued")
        })
    public ResponseEntity generateToken(
        @RequestParam
        final String service,
        @RequestHeader("Credential")
        final String authorization) {
        return FunctionUtils.doAndHandle(() -> {
            val credential = extractCredential(authorization);
            val givenService = extractService(service);
            val result = generateToken(credential, givenService);
            return ResponseEntity.ok(result);
        }, e -> ResponseEntity.badRequest().body("Invalid or unauthenticated request")).get();
    }
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