Here you can find the source of getTokenRenewIntervalInSeconds(int tokenValidityInSeconds)
static int getTokenRenewIntervalInSeconds(int tokenValidityInSeconds)
//package com.java2s; /*/*from w w w . j a v a2 s . c o m*/ * Copyright (c) Microsoft. All rights reserved. * Licensed under the MIT license. See LICENSE file in the project root for full license information. */ public class Main { static int getTokenRenewIntervalInSeconds(int tokenValidityInSeconds) { if (tokenValidityInSeconds >= 300) { return tokenValidityInSeconds - 30; } else if (tokenValidityInSeconds >= 60) { return tokenValidityInSeconds - 10; } else { return (tokenValidityInSeconds - 1) > 0 ? tokenValidityInSeconds - 1 : 0; } } }