@ReadOperation(produces = MediaType.APPLICATION_JSON_VALUE)
    @Operation(summary = "Fetch Duo Security user account status", parameters = {
        @Parameter(name = "username", required = true, description = "The username to fetch"),
        @Parameter(name = "providerId", description = "The multifactor authentication provider id defined in CAS settings")
    })
    public Map<?, ?> fetchAccountStatus(@Selector final String username, @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(provider -> {
                val duoService = provider.getDuoAuthenticationService();
                val accountStatus = duoService.getUserAccount(username);
                results.put(provider.getId(),
                    CollectionUtils.wrap("duoApiHost", resolver.resolve(duoService.getProperties().getDuoApiHost()),
                        "name", provider.getFriendlyName(),
                        "accountStatus", accountStatus
                    ));
            });
        return results;
    }
Fetch account status map.

@param username   the username
@param providerId the provider id
@return the map
support/cas-server-support-duo-core/src/main/java/org/apereo/cas/adaptors/duo/web/DuoSecurityUserAccountStatusEndpoint.java