title: Is it possible to set QuickBooks Online access token expiration or lifetime
body: <p>I'm not sure if this is even possible, but the oAuth playground at:</p>
  
  <p><a href="https://appcenter.intuit.com/Playground/OAuth/IA/?ck=consumer_key&amp;cs=consumer_secret" rel="nofollow">https://appcenter.intuit.com/Playground/OAuth/IA/?ck=consumer_key&amp;cs=consumer_secret</a></p>
  
  <p>seems to suggest that it is. Along with consumer key/secret field, there's an access token expiry field. The subsequent URL that's used is: </p>
  
  <p><a href="https://appcenter.intuit.com/Connect/SessionStart?grantUrl=https%3A%2F%2Fappcenter.intuit.com%2FPlayground%2FOAuth%2FBeginIAFlow%3Fconsumer_key%3D%5bmy_consumer_key%5d%26consumer_secret%3D%5bmy_consumer_secret%5d%26access_token_lifetime%3D300" rel="nofollow">https://appcenter.intuit.com/Connect/SessionStart?grantUrl=https%3A%2F%2Fappcenter.intuit.com%2FPlayground%2FOAuth%2FBeginIAFlow%3Fconsumer_key%3D[my_consumer_key]%26consumer_secret%3D[my_consumer_secret]%26access_token_lifetime%3D300</a></p>
  
  <p>The <code>access_token_lifetime</code> parameter at the end is specifying the access token lifetime in seconds, but I've tried inserting this parameter into my URL that's sent to both the request token API and the access token API (not both at the same time, just one or the other separately). For example, for the request token API, I've tried:</p>
  
  <pre><code>HttpParameters additionalParams = new HttpParameters();
  additionalParams.put("oauth_callback", URLEncoder.encode(callback_url, "UTF-8"));
  additionalParams.put("access_token_lifetime", "500");
  ouathconsumer.setAdditionalParameters(additionalParams);
  
  String signedRequestTokenUrl = ouathconsumer.sign(REQUEST_TOKEN_URL);
  signedRequestTokenUrl += "&amp;access_token_lifetime=500";
  </code></pre>
  
  <p>...and for the access token API:</p>
  
  <pre><code>HttpParameters additionalParams = new HttpParameters();
  additionalParams.put("oauth_callback", "oob");
  additionalParams.put("oauth_verifier", verifierCode);
  additionalParams.put("access_token_lifetime", "500");
  consumer.setAdditionalParameters(additionalParams);
  
  String signedURL = consumer.sign(ACCESS_TOKEN_URL);
  signedURL += "&amp;access_token_lifetime=500";
  </code></pre>
  
  <p>Neither has worked. The oAuth process succeeds in both cases, and my developer account shows that a new connection has been establised. But that connection is still valid even after 500 seconds. </p>
  
  <p>However, there's no mention of setting access token expiration time in the Intuit docs for the standard oAuth token expiration (180 days), so I hope that doesn't mean it's not possible:</p>
  
  <p><a href="https://developer.intuit.com/docs/0025_quickbooksapi/0010_getting_started/0020_connect/0010_from_within_your_app/implement_oauth_in_your_app/token_renewal_and_expiration" rel="nofollow">https://developer.intuit.com/docs/0025_quickbooksapi/0010_getting_started/0020_connect/0010_from_within_your_app/implement_oauth_in_your_app/token_renewal_and_expiration</a></p>