class FactorEnrollmentAPIController {

    @RequestMapping(value = "available", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
    @ResponseBody
    public List<Factor> findAvailableFactors(Authentication auth) throws OktaException
    {
        try
        {
            LOGGER.info("Retrieving available factors");
            OktaUser user = getOktaUserService().getUser(auth.getName());
            return getFactorService().listAvailableFactors(user);
        }
        catch (Exception e)
        {
            LOGGER.error("Failed to retrieve available factors", e);
            throw new OktaException(e.getMessage(), e);
        }
    }

}