public Boolean removeFactor ( long userId , long deviceId ) throws OAuthSystemException , OAuthProblemException , URISyntaxException { cleanError ( ) ; prepareToken ( ) ; URIBuilder url = new URIBuilder ( settings . getURL ( Constants . REMOVE_FACTOR_URL , userId , deviceId ) ) ; OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient ( ) ; OAuthClient oAuthClient = new OAuthClient ( httpClient ) ; OAuthClientRequest bearerRequest = new OAuthBearerClientRequest ( url . toString ( ) ) . buildHeaderMessage ( ) ; Map < String , String > headers = getAuthorizedHeader ( ) ; bearerRequest . setHeaders ( headers ) ; Boolean success = true ; OneloginOAuthJSONResourceResponse oAuthResponse = oAuthClient . resource ( bearerRequest , OAuth . HttpMethod . DELETE , OneloginOAuthJSONResourceResponse . class ) ; if ( oAuthResponse . getResponseCode ( ) != 200 ) { success = false ; error = oAuthResponse . getError ( ) ; errorDescription = oAuthResponse . getErrorDescription ( ) ; } return success ; }
Remove an enrolled factor from a user .