public ApiResponse authorizeAppClient ( String clientId , String clientSecret ) { validateNonEmptyParam ( clientId , "client identifier" ) ; validateNonEmptyParam ( clientSecret , "client secret" ) ; assertValidApplicationId ( ) ; loggedInUser = null ; accessToken = null ; currentOrganization = null ; Map < String , Object > formData = new HashMap < String , Object > ( ) ; formData . put ( "grant_type" , "client_credentials" ) ; formData . put ( "client_id" , clientId ) ; formData . put ( "client_secret" , clientSecret ) ; ApiResponse response = apiRequest ( HttpMethod . POST , formData , null , organizationId , applicationId , "token" ) ; if ( response == null ) { return response ; } if ( ! isEmpty ( response . getAccessToken ( ) ) ) { loggedInUser = null ; accessToken = response . getAccessToken ( ) ; currentOrganization = null ; log . info ( "Client.authorizeAppClient(): Access token: " + accessToken ) ; } else { log . info ( "Client.authorizeAppClient(): Response: " + response ) ; } return response ; }
Log the app in with it s client id and client secret key . Not recommended for production apps .