@GetMapping(value = "/{username}", produces = MediaType.APPLICATION_JSON_VALUE)
    @Operation(summary = "Get all present and registered MFA devices for a given user",
        parameters = @Parameter(name = "username", description = "The user that owns registered multifactor devices", in = ParameterIn.PATH))
    public List<MultifactorAuthenticationRegisteredDevice> allMfaDevicesForUser(@PathVariable final String username) throws Throwable {
        val principal = PrincipalFactoryUtils.newPrincipalFactory().createPrincipal(username);
        val providers = MultifactorAuthenticationUtils.getAvailableMultifactorAuthenticationProviders(applicationContext).values();
        return providers
            .stream()
            .filter(provider -> Objects.nonNull(provider.getDeviceManager()))
            .map(provider -> provider.getDeviceManager().findRegisteredDevices(principal))
            .flatMap(List::stream)
            .toList();

    }
All mfa devices for user.

@param username the username
@return the list
@throws Throwable the throwable
support/cas-server-support-reports-core/src/main/java/org/apereo/cas/web/report/MultifactorAuthenticationDevicesEndpoint.java