none
As a Microsoft Partner, how to access Azure AD Domain Management API after sell customer Office 365 Product. RRS feed

  • Question

  • Hi All,
    We are a Microsoft Partner/reseller to provide our customer Microsoft products, Office 365 for example.  We are using set of reseller info (App ID, Key and domain) to communicate CSP Commerce REST API (CREST API) to create customer and subscription in Microsoft Partner console.
    https://msdn.microsoft.com/en-us/library/partnercenter/dn974944.aspx

    Now we want to use Azure Domain Management API to help our customers to verify their domain names programmatically. 

    http://blogs.msdn.com/b/aadgraphteam/archive/2015/07/24/announcing-the-preview-of-domain-management-api.aspx
    After read a number of Docs,  we are still having some questions, hopefully we can get some help from forum and your guys.
    1.  which set of (App ID, Key and domain) shall I use?  I tried reseller info which were used for CREST API. However, I am able to get AADtoken,  but not for other further functions.  If I shall use customer set of info, where shall I get the customer (App ID, Key and domain)?
    2. From this doc, (https://azure.microsoft.com/en-us/documentation/articles/active-directory-how-subscriptions-associated-directory/#manage-the-directory-for-your-office-365-subscription-in-azure)
    As completed new customers, after they purchased Office 365 product in portal, They still need sign up Azure to use Azure portal,  Do I need to "Add an application my organization is developing"  to get the customer set (App ID, Key and domain) ?
    If yes, If there any API we can use to get this customer set (App ID, Key and domain) , as we are trying to automated the whole purchase and provision process, human intervention is the least thing we want to use :)
    Thanks very much in advance  and attached some error from Question 1.

    ----------

    Question 1 Error when use reseller set info to try /tenantDetails function.
    -----

    AADToken is OK

    Request Url = https://login.microsoftonline.com/xxxxx/oauth2/token?api-version=1.0
Request Body = [grant_type=client_credentials, resource=https://graph.windows.net, client_id=exxxxx, client_secret=xxxxx]
AADToken = eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Ik1uQ19WWmNBVGZNNXBPWWlKSE1iYTlnb0VLWSIsImtpZCI6Ik1uQ19WWmNBVGZNNXBPWWlKSE1iYTlnb0VLWSJ9.eyJhdWQiOiJodHRwczovL2dyYXBoLndpbmRvd3MubmV0IiwiaXNzIjoiaHR0cHM6Ly9zdHMud2luZG93cy5uZXQvYTBlZmQyZmEtOGJhNy00NTQ4LWIxM2ItZTgwY2IxYWFjMzhkLyIsImlhdCI6MTQ1NTUwOTgwMCwibmJmIjoxNDU1NTA5ODAwLCJleHAiOjE0NTU1MTM3MDAsImFwcGlkIjoiZTEzMjU3NWQtZGY4Ny00Nzc5LWIzZDctZDA0ZjU4YWE1ZDlmIiwiYXBwaWRhY3IiOiIxIiwiaWRwIjoiaHR0cHM6Ly9zdHMud2luZG93cy5uZXQvYTBlZmQyZmEtOGJhNy00NTQ4LWIxM2ItZTgwY2IxYWFjMzhkLyIsIm9pZCI6ImQ1MzMzOGE3LWJkODUtNGQ3OS04Njk5LWNjYmRkZWFlMGU5OCIsInJvbGVzIjpbIkRpcmVjdG9yeS5SZWFkIl0sInN1YiI6ImQ1MzMzOGE3LWJkODUtNGQ3OS04Njk5LWNjYmRkZWFlMGU5OCIsInRpZCI6ImEwZWZkMmZhLThiYTctNDU0OC1iMTNiLWU4MGNiMWFhYzM4ZCIsInZlciI6IjEuMCJ9.guYOVKRtU0WsRdb-9H-5StjMR5sVLQApS9C3p9Ke7e6Cnt6QSwjgYpfNjSv_LZJy9VLjaRAKja5zicnYS4NpQzAOpgNp21V539TZ9677mN_HmRUHfbKmPGFb41Ps5r16gPlFc5osU5RPDp4oCK6EQuyypCXE0la_Y79YmLiIa0wOwKY7DgdaaNWDDsiDEMdVCFdUHgglPtOT7WakYl3bSfoa0BmHvZJGJI4TCggrixKxJGtB3n6_fWnjaTYbipNOuFMxGz1MrfYdWV6ziNeQgq1N3w-KkoVrymjyAyXLs2pkkKGNrkVJFDa-qItTR0iZT1EMRe_UBSbujd4GHdAilQ


    ----------

    tenantDetails function has error

    input request, https://graph.windows.net/xxxxx.onmicrosoft.com/tenantDetails?api-version=1.0
    org.sampleapp.exceptions.SampleAppException: The identity of the calling application could not be established.
        at org.sampleapp.services.HttpRequestHandler.handleRequest(HttpRequestHandler.java:135)
        at org.sampleapp.test.ApiTest.testgetTenantDetails(ApiTest.java:82)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
        at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
        at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
        at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
    Caused by: java.io.IOException: Server returned HTTP response code: 401 for URL: https://graph.windows.net/xxxxx.onmicrosoft.com/tenantDetails?api-version=1.0
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1839)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1440)
        at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
        at org.sampleapp.services.HttpRequestHandler.handleRequest(HttpRequestHandler.java:82)
        ... 25 more



    Monday, February 15, 2016 4:42 AM

All replies

  • Hello,

     

    We are working on the query and would get back to you soon on this. I apologize for the inconvenience and appreciate your time and patience in this matter.

     

    Best Regards,

    Kamalakar K

    Monday, February 15, 2016 4:42 PM