@GetMapping(path = "/{username}", produces = MediaType.APPLICATION_JSON_VALUE)
    @Operation(summary = "Fetch Duo Security user account from Duo Admin API", parameters = {
        @Parameter(name = "username", required = true, in = ParameterIn.PATH, description = "The username to fetch"),
        @Parameter(name = "providerId", description = "The multifactor authentication provider id defined in CAS settings")
    })
    public Map<String, DuoSecurityUserAccount> getUser(@PathVariable("username") final String username,
                                                       @RequestParam(required = false) final String providerId) {
        val results = new LinkedHashMap<String, DuoSecurityUserAccount>();
        val providers = applicationContext.getBeansOfType(DuoSecurityMultifactorAuthenticationProvider.class).values();
        providers
            .stream()
            .filter(Objects::nonNull)
            .filter(BeanSupplier::isNotProxy)
            .filter(provider -> StringUtils.isBlank(providerId) || provider.matches(providerId))
            .filter(provider -> provider.getDuoAuthenticationService().getAdminApiService().isPresent())
            .forEach(Unchecked.consumer(p -> {
                val duoService = p.getDuoAuthenticationService().getAdminApiService().orElseThrow();
                duoService.getDuoSecurityUserAccount(username).ifPresent(user -> results.put(p.getId(), user));
            }));
        return results;
    }
Fetch duo user account from admin api.

@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/DuoSecurityAdminApiEndpoint.java