@Override
    public List<Long> createDuoSecurityBypassCodesFor(final String userIdentifier) throws Exception {
        val params = CollectionUtils.<String, String>wrap("uri", String.format("users/%s/bypass_codes", userIdentifier));
        params.put("method", HttpMethod.POST.name());
        val bypassResponse = (JSONArray) executeAdminEndpoint(params);
        if (bypassResponse != null) {
            return Arrays.stream(bypassResponse.join(",")
                    .replace("\"", StringUtils.EMPTY).split(","))
                .map(Long::valueOf)
                .collect(Collectors.toList());
        }
        return new ArrayList<>();
    }
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