@Override
    public boolean authorizeRequest(final RegisteredServiceAccessStrategyRequest request) {
        HttpResponse response = null;
        try {
            val headers = new HashMap<String, String>();
            headers.put(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE);
            if (StringUtils.isNotBlank(token)) {
                headers.put(HttpHeaders.AUTHORIZATION, "Bearer " + SpringExpressionLanguageValueResolver.getInstance().resolve(this.token));
            }
            val url = StringUtils.removeEnd(SpringExpressionLanguageValueResolver.getInstance().resolve(this.apiUrl), "/");
            val store = StringUtils.removeEnd(SpringExpressionLanguageValueResolver.getInstance().resolve(this.storeId), "/");
            val fgaApiUrl = String.format("%s/stores/%s/check", url, store);

            val checkEntity = AuthorizationRequestEntity.builder()
                .object(StringUtils.defaultIfBlank(this.object, request.getService().getId()))
                .relation(StringUtils.defaultIfBlank(this.relation, "owner"))
                .user(StringUtils.defaultIfBlank(this.userType, "user") + ':' + request.getPrincipalId())
                .build()
                .toJson();
            val exec = HttpExecutionRequest.builder()
                .method(HttpMethod.POST)
                .url(fgaApiUrl)
                .headers(headers)
                .entity(checkEntity)
                .build();
            LOGGER.debug("Submitting authorization request to [{}] for [{}]", fgaApiUrl, checkEntity);
            response = HttpUtils.execute(exec);
            if (HttpStatus.resolve(response.getCode()).is2xxSuccessful()) {
                try (val content = ((HttpEntityContainer) response).getEntity().getContent()) {
                    val results = IOUtils.toString(content, StandardCharsets.UTF_8);
                    LOGGER.trace("Received response from endpoint [{}] as [{}]", url, results);
                    val payload = MAPPER.readValue(results, Map.class);
                    return (Boolean) payload.getOrDefault("allowed", Boolean.FALSE);
                }
            }
        } catch (final Exception e) {
            LoggingUtils.error(LOGGER, e);
        } finally {
            HttpUtils.close(response);
        }
        return false;
    }
This is {@link OpenFGARegisteredServiceAccessStrategy} that reaches out
to OpenFGA to check for user access.

@author Misagh Moayyed
@since 7.0.0
core/cas-server-core-services-api/src/main/java/org/apereo/cas/services/OpenFGARegisteredServiceAccessStrategy.java