src/Microsoft.IdentityModel.Tokens/TokenUtilities.cs
/// <summary>
/// Check whether the given configuration is recoverable by LKG.
/// </summary>
/// <param name="validationParameters">The <see cref="TokenValidationParameters"/> to be used for validation.</param>
/// <param name="configuration">The <see cref="BaseConfiguration"/> to check.</param>
/// <param name="currentConfiguration">The updated <see cref="BaseConfiguration"/>.</param>
/// <returns><c>true</c> if the configuration is recoverable otherwise, <c>false</c>.</returns>
Check whether the given configuration is recoverable by LKG.
Check whether the given configuration is recoverable by LKG .
internal static bool IsRecoverableConfiguration(TokenValidationParameters validationParameters, BaseConfiguration configuration, out BaseConfiguration currentConfiguration)
        {
            bool isRecoverableConfiguration = (validationParameters.ConfigurationManager.UseLastKnownGoodConfiguration
                && validationParameters.ConfigurationManager.LastKnownGoodConfiguration != null
                && !ReferenceEquals(configuration, validationParameters.ConfigurationManager.LastKnownGoodConfiguration));
            currentConfiguration = configuration;
            if (isRecoverableConfiguration)
            {
                if (!validationParameters.ConfigurationManager.IsLastKnownGoodValid)
                    LogHelper.LogInformation(TokenLogMessages.IDX10263);
                else                
                    currentConfiguration = validationParameters.ConfigurationManager.LastKnownGoodConfiguration;
            }
            return isRecoverableConfiguration;
        }
internal static bool IsRecoverableConfiguration ( TokenValidationParameters validationParameters , BaseConfiguration configuration , out BaseConfiguration currentConfiguration ) { bool isRecoverableConfiguration = ( validationParameters . ConfigurationManager . UseLastKnownGoodConfiguration && validationParameters . ConfigurationManager . LastKnownGoodConfiguration != null && ! ReferenceEquals ( configuration , validationParameters . ConfigurationManager . LastKnownGoodConfiguration ) ) ; currentConfiguration = configuration ; if ( isRecoverableConfiguration ) { if ( ! validationParameters . ConfigurationManager . IsLastKnownGoodValid ) LogHelper . LogInformation ( TokenLogMessages . IDX10263 ) ; else currentConfiguration = validationParameters . ConfigurationManager . LastKnownGoodConfiguration ; } return isRecoverableConfiguration ; }
Check whether the given configuration is recoverable by LKG.
Check whether the given configuration is recoverable by LKG .
// Inform the user that the LKG is expired.
None
validationParameters
TokenValidationParameters
The  to be used for validation.
The to be used for validation .
configuration
BaseConfiguration
The  to check.
The to check .
BaseConfiguration
out
currentConfiguration
The updated .
The updated .