prismatic-io / embedded

Prismatic's library for embedding Prismatic.io into your application.
MIT License
24 stars 3 forks source link

JWT token refresh example for example app #86

Open taylorreece opened 2 weeks ago

taylorreece commented 2 weeks ago

Embedded tokens can (and should) have a short expiration time, and tokens used by iframes, etc., can be refreshed automatically be calling prismatic.authenticate() with a newly generated token.

This adds token refresh to our example embedded app. Users can specify tokenValidSeconds in their config, and tokens will automatically refresh 30 seconds ahead of token expiration.