Auth0 Home Blog Docs

jquery refresh access token



I have built a simple SPA using ONLY jQuery, html and css and am successfully authenticating access to it using auth0.

I would like to refresh a users access token automatically but can’t work out how to do this - the SDK quickstart for jquery token renewal gives an example using an Express server and Node.js but I am using a simple Apache server (my web host) and don’t know how to amend the server.js /silent.html files or where to put these files given that I am not using Express or Node.js.

Can anybody please help me out?


The quickstart you mention relies on a Node.js server, but only for the purpose of serving a static file so you would only need to also serve the /silent.html static file from any other web server you decide to use.

Having said that, you may also want to consider using the Auth0.js checkSession method instead of the renewAuth as that will mean the static file is no longer a requirement. Be sure to read the linked documentation as the method does require some configuration on the client settings.