none
[UWP] 500 Error when Requesting Subscriptions from a Service

    Question

  • We have an issue where after creating the appropriate Microsoft store tokens, passing them into the app and receiving a Microsoft Store ID via getCustomerPurchaseIdAsync, when using the value passed back to our services as the B2B key to request subscriptions, it gives us this 500 error:
    {
       “code”: “InternalServerError”,
       “data”: [],
       “details”: [],
       “innererror”: {
           “code”: “InternalAadAuthenticationError”,
           “data”: [
               “B2B key”
           ],
           “details”: [],
           “message”: “Internal error during AAD authentication.”
       },
       “message”: “An internal server error occurred while processing the operation.“,
       “source”: “PurchaseFD”

    }

    We're going by exactly what documentation tells us to. Could it be a similar issue to the one listed in this thread? https://social.msdn.microsoft.com/Forums/en-US/6a85adae-289b-40aa-9c18-2d1bc0649cac/uwpgetting-subscriptions-for-a-user-returns-a-500-status?forum=wpdevelop

    Tuesday, November 6, 2018 1:24 PM

Answers

  • Issue was related to bug where the token was being truncated and has since been fixed! Thanks for your help.
    • Marked as answer by HD Russell Monday, November 12, 2018 3:22 PM
    Monday, November 12, 2018 3:22 PM

All replies

  • Hi

    How did you generate the token, used some http tool such as postman or in program? Have you referred to this store sample? In this sample, seventh scenario includes the method to get customer PurchaseId.

    If the error is the same, you can try to do:

    1.  Change another account to test this issue.
    2. Contact the store for support( http://aka.ms/storesupport   ), check the issue if it is caused in service-end.

    Best regards,

    Roy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, November 7, 2018 9:06 AM
  • We are generating the tokens with our backend service, as outlined by the directions from this page, we have also attempted this with postman: https://docs.microsoft.com/en-us/windows/uwp/monetize/view-and-grant-products-from-a-service#step-3

    We are then using those tokens generated remotely in our app to obtain the Purchase ID, pass that back to our service to use and then make a call to view subscription information. We need to access this information from our services to account for user accounts on other platforms but were purchased on MS's store.

    I'll contact the store as well because it seems like this isn't the only instance of this issue occurring.

    Also, thank you for outlining what options to choose for submitting the ticket! That portal can be misleading at times.

    • Edited by HD Russell Wednesday, November 7, 2018 2:23 PM
    Wednesday, November 7, 2018 2:20 PM
  • Hi Roy,

    After attempting this, they redirected me to both the forums and a different ticket submission service which requires payment. Is this the only available support?

    Thursday, November 8, 2018 2:27 PM
  • Hi,

    Well, The token that is used as a parameter for request a B2Bkey is different from the token you create as Azure AD access token.
    When you create Azure AD access token, you are using https://onestore.microsoft.com as 'resource' parameter. But it is mentioned in the document for creating a Microsoft Store ID key that "Pass the Azure AD access token that has the audience URI value https://onestore.microsoft.com/b2b/keys/create/purchase from your service to your client app." So you need to request for another token that could help you to request the Microsoft Store ID key. 

    So in short:

    1. Create Azure AD access token using https://onestore.microsoft.com as 'resource' parameter.
    2. Then create another Azure AD access token using https://onestore.microsoft.com/b2b/keys/create/purchase as 'resource' parameter.
    3. Request Microsoft Store ID key

    Please make sure that you are getting the right token and B2B key first.

    Best regards,

    Roy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, November 9, 2018 5:43 AM
  • Issue was related to bug where the token was being truncated and has since been fixed! Thanks for your help.
    • Marked as answer by HD Russell Monday, November 12, 2018 3:22 PM
    Monday, November 12, 2018 3:22 PM