@legtech/azureauthentication
v2.0.0
Published
Function to extend Azure AD token lifetime through javascript polling
Downloads
21
Keywords
Readme
Function to initiate polling that will keep your Azure AD token alive. Needed with POSTs and ajax calls.
To use, put the following in your layout (or in a single view if applicable):
<script>
var renewUrl = WSL.Url.resolve([Your renewal url]);
WSLApp.AzureAuthentication.renewAzureSessionBeforeExpiration([token expiration string],renewUrl, [tokenLifetimeInMinutes], [expirationBufferInMinutes]);
</script>
Notes:
- Your renewal url should be a link to a controller method that forces a reauthentication
- Your token expiration string should be the expriation of your access token which is found in the claim.
- Your tokenLifetimeInMinutes is how long your token is configured to last in Azure AD. Typically this is 1 hour (ask TSG to confirm for your app if needed). This js file defaults to 60 mins if you don't pass a value.
- Your expirationBufferInMinutes is the buffer allowed before token expiration when a re-auth is tried. This js file defaults to 5 minutes if you don't pass a value.