public async Task AcquireTokenWithUI()

in CredentialProvider.Microsoft/CredentialProviders/Vsts/AdalTokenProvider.cs [80:108]


        public async Task<IAdalToken> AcquireTokenWithUI(CancellationToken cancellationToken)
#pragma warning restore CS1998 // Async method lacks 'await' operators and will run synchronously
        {
#if NETFRAMEWORK
            var authenticationContext = new AuthenticationContext(authority, tokenCache);

            var parameters = new PlatformParameters(PromptBehavior.Always);

            try
            {
                var result = await authenticationContext.AcquireTokenAsync(resource, clientId, new Uri(NativeClientRedirect), parameters);
                cancellationToken.ThrowIfCancellationRequested();

                return new AdalToken(result);
            }
            catch (AdalServiceException e)
            {
                if (e.ErrorCode == AdalError.AuthenticationCanceled)
                {
                    return null;
                }

                throw;
            }
#else
            // no UI in ADAL on netcore
            return null;
#endif
        }