private bool TryCache()

in CredentialProvider.Microsoft/RequestHandlers/GetAuthenticationCredentialsRequestHandler.cs [138:158]


        private bool TryCache(GetAuthenticationCredentialsRequest request, out string cachedToken)
        {
            cachedToken = null;

            Logger.Verbose(string.Format(Resources.IsRetry, request.IsRetry));
            if (request.IsRetry)
            {
                Logger.Verbose(string.Format(Resources.InvalidatingCachedSessionToken, request.Uri.AbsoluteUri));
                cache?.Remove(request.Uri);
                return false;
            }
            else if (cache.TryGetValue(request.Uri, out string password))
            {
                Logger.Verbose(string.Format(Resources.FoundCachedSessionToken, request.Uri.AbsoluteUri));
                cachedToken = password;
                return true;
            }

            Logger.Verbose(string.Format(Resources.CachedSessionTokenNotFound, request.Uri.AbsoluteUri));
            return false;
        }