Authorize .NET applications developed for Intel Atom Developer Platform


This article has further simplified the process to make calls to ADP service for authorization. I am thankful to intel community admin for providing the dll wrapper/code and procedure.

What is to be done? The application made for Intel ADP needs to call ADP service API to validate whether the user is authorized to run the application or not. Depending on the return value, application has to respond properly.

What is the problem? Right now the service API is available only in C++ so dot net application requires to make the API call through a wrapper around the unmanaged DLL.

Here is how we are going to solve the problem
  1. Download the com DLL: Download the com wrapper dll (Courtsey intel community admin version 0.91).
    Update (06/29/2010): A new version of Intel Atom SDK (0.92) has been released. Here is the latest DLL I have compiled using new SDK lib and header files.

    Unzip the downloaded file. Open the software project and add a reference to this file.

    Click "Project" > "Add Reference" menu. In the new window click "Browse" tab. Browse to the file, select it and click ok button.



  2. Download ADP helper class: Download this C# helper class and unzip it. Add it to the project by clicking "Project" > "Add Existing Item" menu.



  3. Open the IADP.cs code: In the .NET IDE double click "IADP.cs" in solution explorer to view the code. Important: At the top of the source code there is a line namespace MultiEMailNotifier, change "Multi Email Notifier" to whatever namespace your project have.

  4. Call the dll from application code: Here is the code which call the function in IADP.cs to check whether the application should run or not. IADP.cs is a static class so you do not need to create an instance.

                       bool success = IADP.validateADP("0xa695f485,0x95119641,0xb08e0611,0x1d309f54");
                      if (success == false ) 
                       {
                           MessageBox.Show("Error Occurred: " + IADP.ErrorText + Environment.NewLine, 
    "Error Authorization",MessageBoxButtons.OK,MessageBoxIcon.Error);
                           return; //here you have to stop application
                       }

    On line 1 what you see as string argument being passed to "IADP.validateADP" function, is your application GUID which you receive after registering your application at http://appdeveloper.intel.com/en-us/


  5. I hope this makes the integration of ADP service validation for your software easy. We have implemented the IADP SDK in our email notifier software Multi Email Notifier. Let us know if you have any problem in implementing the code.

    NOTE: How to debug / test the application using Application Test and Debug Service (ATDS)
    An application or component can only be tested using a Debug ID, Production ID will fail the validation test.

    In IADP.cs find the code block shown below. Uncomment line number 3 and comment line number 4 to make the Debug ID active.

       1:              else if (rc == ReturnCode.ADP_SUCCESS)
       2:              {
       3:                  //rc = wrapper.IsAuthorized(AdpService.DebugApplicationId);
       4:                  rc = wrapper.IsAuthorized(ParseStoreGuid(appGUID));
       5:                  if (rc != ReturnCode.ADP_AUTHORIZED)
       6:                  {
       7:                      _errorText = "It appears that you are not authorized to use this software...";
       8:                      noError = false;
       9:                  }
      10:              }

    Before running the application start ATDS service by running runATDS.bat file.

    Caution: Once tested comment line number 3 and uncomment line number 4 to make sure that Production ID is active.



Share on facebook Share on twitter Share on Digg Share on Technorati Share on LinkedIn Share on Delicious Share on MySpace Share on Reddit Share on StumbleUpon Share on Tumblr
social media