code: public List<AuthFactor> getFactors(long userId) throws OAuthSystemException, OAuthProblemException, URISyntaxException
      {
  		cleanError();
  		prepareToken();
  
  		URIBuilder url = new URIBuilder(settings.getURL(Constants.GET_FACTORS_URL, userId));
  
  		OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient();
  		OAuthClient oAuthClient = new OAuthClient(httpClient);
  		OAuthClientRequest bearerRequest = new OAuthBearerClientRequest(url.toString())
  			.buildHeaderMessage();
  
  		Map<String, String> headers = getAuthorizedHeader();
  		bearerRequest.setHeaders(headers);
  
  		List<AuthFactor> authFactors = new ArrayList<AuthFactor>();
  		OneloginOAuthJSONResourceResponse oAuthResponse = oAuthClient.resource(bearerRequest, OAuth.HttpMethod.GET, OneloginOAuthJSONResourceResponse.class);
  
  		if (oAuthResponse.getResponseCode() == 200) {
  			JSONObject data = oAuthResponse.getData();
  			if (data.has("auth_factors")) {
  				JSONArray dataArray = data.getJSONArray("auth_factors");
  				if (dataArray != null && dataArray.length() > 0) {
  					AuthFactor authFactor;
  					for (int i = 0; i < dataArray.length(); i++) {
  						authFactor = new AuthFactor(dataArray.getJSONObject(i));
  						authFactors.add(authFactor);
  					}
  				}
  			}
  		} else {
  			error = oAuthResponse.getError();
  			errorDescription = oAuthResponse.getErrorDescription();
  		}
  
  		return authFactors;
      }
docs: Returns a list of authentication factors that are available for user enrollment
  via API.
  
  @param userId
  The id of the user.
  
  @return Array AuthFactor list
  
  @throws OAuthSystemException - if there is a IOException reading parameters of the httpURLConnection
  @throws OAuthProblemException - if there are errors validating the OneloginOAuthJSONResourceResponse and throwOAuthProblemException is enabled
  @throws URISyntaxException - if there is an error when generating the target URL at the URIBuilder constructor
  
  @see <a target="_blank" href="https://developers.onelogin.com/api-docs/1/multi-factor-authentication/available-factors">Get Available Authentication Factors documentation</a>