Esempio n. 1
0
        public static async Task <IAcrClient> CreateAsync(string acrName, string tenant, string username, string password,
                                                          ILoggerService loggerService, IHttpClientProvider httpClientProvider)
        {
            string aadAccessToken = await AuthHelper.GetAadAccessTokenAsync("https://management.azure.com", tenant, username, password);

            return(new AcrClient(httpClientProvider.GetClient(), acrName, tenant, aadAccessToken, loggerService));
        }
Esempio n. 2
0
 private Task RefreshAccessTokenAsync() =>
 this.accessToken.ResetValueAsync(
     () => AuthHelper.GetAadAccessTokenAsync(McrStatusResource, this.tenant, this.clientId, this.clientSecret));
Esempio n. 3
0
 private Task <string> GetAccessTokenAsync() =>
 _accessToken.GetValueAsync(
     () => AuthHelper.GetAadAccessTokenAsync(McrStatusResource, _tenant, _clientId, _clientSecret));