2

I have to go through a pin-authentication process to get an access token. How long does this access token last? Do I need to do anything to keep the session alive or do I just need to store the token?

What doesn't make too much sense is that I have gone through the pin-auth process numerous times and according to developer.nest.com/clients I still only have 1 current user/1000 which makes me think that the existing one is destroyed every time I ask for a new one.

Enigma
  • 1,247
  • 3
  • 20
  • 51
  • take a look at this question. http://stackoverflow.com/questions/24560187/what-happens-after-the-nest-access-token-expires – Roy du Crocq Oct 23 '14 at 11:49

2 Answers2

1

The OAuth 2.0 specification defines a expires_in field in the token:

The lifetime in seconds of the access token. For example, the value "3600" denotes that the access token will expire in one hour from the time the response was generated. If omitted, the authorization server SHOULD provide the expiration time via other means or document the default value.

Community
  • 1
  • 1
devin_s
  • 3,345
  • 1
  • 27
  • 32
  • While this may help someone make a library to get the expiration time, it doesn't help with Nest, which is what the question was about. The module I'm using has the same value in the Client class but I was asking before having a process that obtained an access token so I had no data to check as such the question was looking for a reference to the specific Nest token lifetime. – Enigma Oct 23 '14 at 13:52
0

I got a value of 1729295254.0 when using the Sanction Python module to get an OAuth access token which translates to ~54 years provided I did the math right and the initial value was in seconds.

The answer to the second question is most likely that it is due to which nest account is logged in (has always been the same one for me).

Enigma
  • 1,247
  • 3
  • 20
  • 51