private static async Task <ManagerFactory> CreateManagerFactory() { Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext authenticationContext = new Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext(authority.ToString(), false); AuthenticationResult authResult = null; authResult = await authenticationContext.AcquireTokenAsync(resource, new ClientCredential(clientId, clientSecret)); ClientCredentialsToken clientCredentialsToken = new ClientCredentialsToken(authResult.AccessToken); RetailServerContext retailServerContext = RetailServerContext.Create(retailServerUrl, operatingUnitNumber, clientCredentialsToken); ManagerFactory factory = ManagerFactory.Create(retailServerContext); return(factory); }
public HttpClient GetClientCredentialsHttpClient(ClientCredentialsTokenOptions options, HttpMessageHandler handler) { IRemoteToken remoteToken = new ClientCredentialsToken(options); return(GetHttpClient(remoteToken, handler)); }
public HttpClient GetClientCredentialsHttpClient(ClientCredentialsTokenOptions options) { IRemoteToken remoteToken = new ClientCredentialsToken(options); return(GetHttpClient(remoteToken)); }