I am using the restify-oauth2 repo from here: https://github.com/domenic/restify-oauth2
In the readme it mentions tokenExpirationTime
but never tells how to use it. Here is all it says about it:
- tokenExpirationTime: the value returned for the expires_in component of the response from the token endpoint. Note that this is only the value reported; you are responsible for keeping track of token expiration yourself and calling back with false from authenticateToken when the token expires. Defaults to Infinity.
If someone could point me in the right direction or knows how to use this that would be much appreciated. Thanks in advance!
So I figured out how to add
tokenExpirationTime
to the request. Here is what I did.First added the variable to the environments in my config:
I made the tokens expire in one hour for production. For my development environment I am making the tokens never expire by adding this line.
To use this config variable in the
server.js
file I add it totokenExpirationTime
to my ropc setup.Now when you log in it uses the times I defined in my config file. I still need to figure out how to pull that
expires_in
and either refresh the time or send back not authenticated.As for the scope of this question it is answered.