Microsoft.WindowsAzure.Commands.Utilities.Common.Authentication.AdalTokenProvider.GetCachedToken C# (CSharp) 메소드

GetCachedToken() 공개 메소드

public GetCachedToken ( WindowsAzureSubscription subscription, string userId ) : IAccessToken
subscription WindowsAzureSubscription
userId string
리턴 IAccessToken
        public IAccessToken GetCachedToken(WindowsAzureSubscription subscription, string userId)
        {
            var key = tokenCache.Keys.FirstOrDefault(k => k.UserId == userId && k.TenantId == subscription.ActiveDirectoryTenantId);
            if (key == null)
            {
                throw new AadAuthenticationFailedException(string.Format(Resources.NoCachedToken,
                    subscription.SubscriptionName, userId));
            }

            return new AdalAccessToken(DecodeCachedAuthResult(key), this, new AdalConfiguration(subscription));
        }