Authentication and OData service call

Once the required packages have been added to your project and the entity proxy has been generated, the next step is to implement the code to authenticate and consume OData entities. An OData Service call will need an authorization token passed as a header on the service request. You can implement this as follows:

  1. Using the ADAL library, retrieve the authentication token from the Azure Active directory.
  2. Using generated proxy classes, you can instantiate the data entity objects, set properties, and call methods to interact with the OData endpoint.

The Dynamics 365 for Finance and Operations product team has developed sophisticated examples of consuming OData services in C#, which are available on GitHub. The sample code can be downloaded from https://github.com/Microsoft/Dynamics-AX-Integration.

To learn more about Azure Active Directory authentication using the ADAL library, take a look at the Microsoft documentation site: https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-authentication-libraries.

In this section, we learned how to consume Finance and Operation OData services in the C# programming language. Similarly, you can use OData libraries and Azure active directory authentication libraries in various other development platforms, such as Java, JavaScript, Node.js, PHP, curl, and many others to consume Finance and Operations OData services.

Now, let's explore another popular programming model in Finance and Operations called custom services.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.188.160