Skip to content

Commit 053edf9

Browse files
Cgoodwin/windows store id key updates (#5035)
* Updated lifetime to 30 days, Azure AD -> Entra ID, and renewal ability now only while * Adding missed / for link * fixing a few typos
1 parent d268ab5 commit 053edf9

File tree

2 files changed

+45
-48
lines changed

2 files changed

+45
-48
lines changed

uwp/monetize/renew-a-windows-store-id-key.md

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,31 @@
22
ms.assetid: 3569C505-8D8C-4D85-B383-4839F13B2466
33
description: Learn how to renew an expired Microsoft Store ID key using the renew method in the Microsoft Store collection and purchase APIs.
44
title: Renew a Microsoft Store ID key
5-
ms.date: 04/22/2021
5+
ms.date: 12/06/2024
66
ms.topic: article
77
keywords: windows 10, uwp, Microsoft Store collection API, Microsoft Store purchase API, Microsoft Store ID key, renew
88
ms.localizationpriority: medium
99
---
1010
# Renew a Microsoft Store ID key
1111

12-
13-
Use this method to renew a Microsoft Store key. When you [generate a Microsoft Store ID key](view-and-grant-products-from-a-service.md#step-4), the key is valid for 90 days. After the key expires, you can use the expired key to renegotiate a new key by using this method.
12+
Use this method to renew a Microsoft Store key. When you [generate a Microsoft Store ID key](view-and-grant-products-from-a-service.md#step-4), the key is valid for 30 days. Before the key expires, you can use it to renegotiate a new key by using this method.
1413

1514
The [Microsoft.StoreServices library](https://github.com/microsoft/Microsoft-Store-Services) provides the functionality of this method through the UserStoreId.RefreshStoreId API.
1615

16+
> [!NOTE]
17+
> Previously Microsoft Store keys had a longer lifetime and in some cases were able to be renewed after the key had already expired.
18+
> Now, developers should only expect keys to be renewable during their lifetime and should note the expire date on the keys in order to renew them before they expire.
1719
18-
## Prerequisites
20+
> [!IMPORTANT]
21+
> Although Microsoft Store keys are able to be renewed before they expire, the keys may be revoked prior to their expire dates in response to security concerns.
22+
> Therefore, your services should handle the case where a renewal attempt fails with the AuthenticationTokenInvalid.
23+
> In this case, you should generate a new Microsoft Store key for the user on the client or the method used to generate the original Microsoft Store key.
1924
25+
## Prerequisites
2026

2127
To use this method, you will need:
2228

23-
* An Azure AD access token that has the audience URI value `https://onestore.microsoft.com`.
29+
* An Entra ID access token that has the audience URI value `https://onestore.microsoft.com/.default`.
2430
* An expired Microsoft Store ID key that was [generated from client-side code in your app](view-and-grant-products-from-a-service.md#step-4).
2531

2632
For more information, see [Manage product entitlements from a service](view-and-grant-products-from-a-service.md).
@@ -34,7 +40,6 @@ For more information, see [Manage product entitlements from a service](view-and-
3440
| Collections | POST | ```https://collections.mp.microsoft.com/v6.0/b2b/keys/renew``` |
3541
| Purchase | POST | ```https://purchase.mp.microsoft.com/v6.0/b2b/keys/renew``` |
3642

37-
3843
### Request header
3944

4045
| Header | Type | Description |
@@ -43,15 +48,13 @@ For more information, see [Manage product entitlements from a service](view-and-
4348
| Content-Length | number | The length of the request body. |
4449
| Content-Type | string | Specifies the request and response type. Currently, the only supported value is **application/json**. |
4550

46-
4751
### Request body
4852

4953
| Parameter | Type | Description | Required |
5054
|---------------|--------|-----------------------------------|----------|
51-
| serviceTicket | string | The Azure AD access token. | Yes |
55+
| serviceTicket | string | The Entra ID access token. | Yes |
5256
| key | string | The expired Microsoft Store ID key. | Yes |
5357

54-
5558
### Request example
5659

5760
```syntax
@@ -68,14 +71,12 @@ Host: collections.mp.microsoft.com
6871

6972
## Response
7073

71-
7274
### Response body
7375

7476
| Parameter | Type | Description |
7577
|-----------|--------|------------------------------------------------------------------------------------------------------------------------|
7678
| key | string | The refreshed Microsoft Store key that can be used in future calls to the Microsoft Store collections API or purchase API. |
7779

78-
7980
### Response example
8081

8182
```syntax
@@ -95,16 +96,13 @@ Date: Tue, 13 Sep 2015 07:31:12 GMT
9596

9697
## Error codes
9798

98-
9999
| Code | Error | Inner error code | Description |
100100
|------|--------------|----------------------------|---------------|
101-
| 401 | Unauthorized | AuthenticationTokenInvalid | The Azure AD access token is invalid. In some cases the details of the ServiceError will contain more information, such as when the token is expired or the *appid* claim is missing. |
102-
| 401 | Unauthorized | InconsistentClientId | The *clientId* claim in the Microsoft Store ID key and the *appid* claim in the Azure AD access token do not match. |
103-
101+
| 401 | Unauthorized | AuthenticationTokenInvalid | The Entra ID access token or the Microsoft Store Key being renewed are invalid. In some cases the details of the ServiceError will contain more information, such as when the token is expired or the *appid* claim is missing. |
102+
| 401 | Unauthorized | InconsistentClientId | The *clientId* claim in the Microsoft Store ID key and the *appid* claim in the Entra ID access token do not match. |
104103

105104
## Related topics
106105

107-
108106
* [Manage product entitlements from a service](view-and-grant-products-from-a-service.md)
109107
* [Query for products](query-for-products.md)
110108
* [Report consumable products as fulfilled](report-consumable-products-as-fulfilled.md)

0 commit comments

Comments
 (0)