class FactorEnrollmentAPIController {

    @RequestMapping(method = RequestMethod.DELETE, produces = MediaType.APPLICATION_JSON_VALUE)
    @ResponseBody
    public void deleteFactor(@RequestParam("factorId") String id, Authentication auth)
            throws OktaException
    {
        Preconditions.checkNotNull(id, "factor id is null");

        try
        {
            LOGGER.info("Deleting factor [{}] for user [{}]", id, auth.getName());
            OktaUser user = getOktaUserService().getUser(auth.getName());
            getFactorService().deleteFactor(id, user);
        }
        catch (Exception e)
        {
            LOGGER.error("Failed to delete factor [{}] for user [{}]", id, auth.getName(), e);
            throw new OktaException(e.getMessage(), e);
        }
    }

}