@Override
    public Optional<DuoSecurityUserAccount> getDuoSecurityUserAccount(final String username, final boolean fetchBypassCodes) throws Exception {
        val userResponse = (JSONArray) executeAdminEndpoint(CollectionUtils.wrap("uri", "users", "username", username));
        if (userResponse != null && userResponse.length() == 1) {
            val userJson = userResponse.getJSONObject(0);
            val user = mapDuoSecurityUserAccount(userJson);
            if (fetchBypassCodes) {
                user.addBypassCodes(getDuoSecurityBypassCodesFor(user.getUserId()));
            }
            return Optional.of(user);
        }
        return Optional.empty();
    }
This is {@link DefaultDuoSecurityAdminApiService}.

@author Misagh Moayyed
@since 6.4.0
support/cas-server-support-duo-core/src/main/java/org/apereo/cas/adaptors/duo/authn/DefaultDuoSecurityAdminApiService.java