public List < App > getUserApps ( long id ) throws OAuthSystemException , OAuthProblemException , URISyntaxException { cleanError ( ) ; prepareToken ( ) ; URIBuilder url = new URIBuilder ( settings . getURL ( Constants . GET_APPS_FOR_USER_URL , Long . toString ( id ) ) ) ; 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 < App > apps = new ArrayList < App > ( ) ; App app = null ; OneloginOAuthJSONResourceResponse oAuthResponse = oAuthClient . resource ( bearerRequest , OAuth . HttpMethod . GET , OneloginOAuthJSONResourceResponse . class ) ; if ( oAuthResponse . getResponseCode ( ) == 200 ) { JSONObject [ ] dataArray = oAuthResponse . getDataArray ( ) ; if ( dataArray != null && dataArray . length > 0 ) { for ( JSONObject data : dataArray ) { app = new App ( data ) ; apps . add ( app ) ; } } } else { error = oAuthResponse . getError ( ) ; errorDescription = oAuthResponse . getErrorDescription ( ) ; } return apps ; }
Gets a list of apps accessible by a user not including personal apps .