예제 #1
0
        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);
        }
예제 #2
0
        public HttpClient GetClientCredentialsHttpClient(ClientCredentialsTokenOptions options, HttpMessageHandler handler)
        {
            IRemoteToken remoteToken = new ClientCredentialsToken(options);

            return(GetHttpClient(remoteToken, handler));
        }
예제 #3
0
        public HttpClient GetClientCredentialsHttpClient(ClientCredentialsTokenOptions options)
        {
            IRemoteToken remoteToken = new ClientCredentialsToken(options);

            return(GetHttpClient(remoteToken));
        }