Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Configure Azure and create dynamics 365 apps using OAuth, WebAPI

Hey Everyone

This time I’ve got full package of app development with CRM. This technique can be used for any type of app development. This is one of my first post with configuration information.

Prerequisites :

  1. Using Azure Management Console
  2. Json Serialize using Newtonsoft
  3. Basic understanding of HttpClient and WebAPI in general
  4. ADAL (Azure Active Directory Authentication Library)

This article will walk you through the steps that you need to configure your application in Azure. Let’s begin

CONFIGURE YOUR APPLICATION USING AZURE MANAGEMENT CONSOLE:

  1. Sign-up for Azure Trial/Office 365/Dynamics 365 (Formerly called as CRM Online) in a single tenant.
  2. Launch your Azure Management Console and Navigate to Active Directory.
  3. Register your application in Azure AD
  4. Choose Native Client Application. You can read more about this in Azure Documentation.
  5. Once you’ve provided the information including Redirect Url. You should see the app dashboard as below
  6. You’ve completed configuration!

USING CONSOLE APPLICATION TO START YOUR VISUAL STUDIO PROJECT

//Retrieve Authentication Token from Azure

You will need to pass your ClientId and RedirectUrl from Azure Management Console. Step 7 shows the clientID which is hidden. That would 32 digit GUID. Here’s the flow how OAUTH works:

  • The Authorization Server is the v2.0 endpoint. It is responsible for ensuring the user’s identity, granting and revoking access to resources, and issuing tokens. It is also known as the identity provider – it securely handles anything to do with the user’s information, their access, and the trust relationships between parties in an flow.
  • The Resource Owner is typically the end-user. It is the party that owns the data, and has the power to allow third parties to access that data, or resource.
  • The OAuth Client is your app, identified by its Application Id. It is usually the party that the end-user interacts with, and it requests tokens from the authorization server. The client must be granted permission to access the resource by the resource owner.
  • The Resource Server is where the resource or data resides. It trusts the Authorization Server to securely authenticate and authorize the OAuth Client, and uses Bearer access_tokens to ensure that access to a resource can be granted.

Here’s the complete understanding on Microsoft Azure Documentation:

//Create Sample

//Search Records using OData Search Filters

Full Code is available on GitHub: https://github.com/apurvgh/Crm_Sdk_Samples/blob/master/Crm_Sdk_Samples/WebAPI_Samples/WebApiOperationHelper.cs

Hope you’ve had fun reading this. Happy WebAPI’ng

Thanks

Apurv

Share the post

Configure Azure and create dynamics 365 apps using OAuth, WebAPI

×

Subscribe to Msdn Blogs | Get The Latest Information, Insights, Announcements, And News From Microsoft Experts And Developers In The Msdn Blogs.

Get updates delivered right to your inbox!

Thank you for your subscription

×