Skip to content

Instantly share code, notes, and snippets.

@shanalikhan
Created September 3, 2017 17:17
Show Gist options
  • Save shanalikhan/b9767ac1765a53f17d79b175d683ba5f to your computer and use it in GitHub Desktop.
Save shanalikhan/b9767ac1765a53f17d79b175d683ba5f to your computer and use it in GitHub Desktop.
Application mode in Dynamics 365 Retail Server
AuthenticationContext authenticationContext = new AuthenticationContext(azureActiveDirectory, false);
AuthenticationResult authResult = null;
authResult = await authenticationContext.AcquireTokenAsync(D365Url, new ClientCredential(clientId, clientSecret));
ClientCredentialsToken clientCredentialsToken = new ClientCredentialsToken(authResult.AccessToken);
RetailServerContext retailServerContext = RetailServerContext.Create(retailServerUri, operatingUnitNumber, clientCredentialsToken);
var factory = ManagerFactory.Create(retailServerContext);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment