code: public void getAccessToken() throws OAuthSystemException, OAuthProblemException {
  		cleanError();
  		OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient();
  		//OAuthClient oAuthClient = new OAuthClient(httpClient);
  		OAuthClientRequest request = OAuthClientRequest
  			.tokenLocation(settings.getURL(Constants.TOKEN_REQUEST_URL))
  			.buildBodyMessage();
  
  		Map<String, String> headers = getAuthorizedHeader(false);
  
  		Map<String, Object> params = new HashMap<String, Object>();
  		params.put("grant_type", GrantType.CLIENT_CREDENTIALS);
  		String body = JSONUtils.buildJSON(params);
  		request.setBody(body);
  
  		updateTokens(httpClient, request, headers);
  	}
docs: Generates an access token and refresh token that you may use to call Onelogin's API methods.
  
  @throws OAuthSystemException - if there is a IOException reading parameters of the httpURLConnection
  @throws OAuthProblemException - if there are errors validating the OneloginOAuthJSONAccessTokenResponse and throwOAuthProblemException is enabled
  
  @see <a target="_blank" href="https://developers.onelogin.com/api-docs/1/oauth20-tokens/generate-tokens">Generate Tokens documentation</a>