protected Optional<Ticket> generateInitialAccessToken(final AccessTokenRequestContext holder) {
        return FunctionUtils.doAndHandle(() -> {
            val accessTokenResult = getConfigurationContext().getAccessTokenGenerator().generate(holder);
            val accessToken = accessTokenResult.getAccessToken().orElseThrow();
            return Optional.of(getConfigurationContext().getTicketRegistry().addTicket(accessToken));
        }, e -> Optional.<Ticket>empty()).get();
    }
Handle request..

@param request  the request
@param response the response
@return the model and view
support/cas-server-support-oidc-core-api/src/main/java/org/apereo/cas/oidc/web/controllers/dynareg/OidcInitialAccessTokenController.java