@ReadOperation(produces = MediaType.APPLICATION_JSON_VALUE)
    @Operation(summary = "Ping Duo Security given the provider id",
        parameters = @Parameter(name = "providerId", description = "The multifactor authentication provider id defined in CAS settings"))
    public Map<?, ?> pingDuo(@Nullable final String providerId) {
        val resolver = SpringExpressionLanguageValueResolver.getInstance();
        val results = new LinkedHashMap<>();
        val providers = applicationContext.getBeansOfType(DuoSecurityMultifactorAuthenticationProvider.class).values();
        providers
            .stream()
            .filter(Objects::nonNull)
            .filter(BeanSupplier::isNotProxy)
            .filter(provider -> StringUtils.isBlank(providerId) || provider.matches(providerId))
            .forEach(p -> {
                val duoService = p.getDuoAuthenticationService();
                val available = duoService.ping();
                results.put(p.getId(),
                    CollectionUtils.wrap("duoApiHost", resolver.resolve(duoService.getProperties().getDuoApiHost()),
                        "name", p.getFriendlyName(), "availability", available
                    ));
            });
        return results;
    }
Ping duo and return availability result.

@param providerId the provider id, if any.
@return the map
support/cas-server-support-duo-core/src/main/java/org/apereo/cas/adaptors/duo/web/DuoSecurityPingEndpoint.java