title: How do I validate stormpath jwt tokens?
body: <p>EDIT: It turns out that the stormpath tokens expire in 4 seconds. Does anyone know how to change this?</p>
  
  <p>I have a REST API written using nodejs. I am using stormpath to manage my users. </p>
  
  <p>I first ask the users to generate a JWT token which I do using stormpath.authenticate. And all the requests to the API thereafter are authenticated using this token. However I can't quite figure out how to authenticate the requests using stormpath.</p>
  
  <p>When I try to call stormpath.authenticateApiRequest I always get a token expired error.</p>
  
  <p>Does anyone have any experience with this?</p>
  
  <p>Authenticating a user:</p>
  
  <pre><code>app.authenticateAccount(request, function(err, result) {
    if (err) {
      callback(err);
    }
    callback(null, result.getAccessTokenResponse());
  }
  </code></pre>
  
  <p>The token is sent back in the REST response. However the token I get is only for 4 seconds. An example token:</p>
  
  <pre><code>{ iss: 'https://api.stormpath.com/v1/applications/327amCVmifPJe3hr09BbiX',
    sub: 'https://api.stormpath.com/v1/accounts/327S85vQ0qSth0raGDZwHN',
    jti: '5c0eb388-b9d4-4303-a9f3-b50ec9c35440',
    iat: 1443702904,
    exp: 1443702908 }
  </code></pre>