Hello @Muhammed Işık ,
To address your questions:
- What exactly does "associate" mean in this context?
The publisherUserId is embedded as a claim inside the JWT (JSON Web Token) that is returned as the Collections ID key. According to the documentation, when the key is decoded, it contains a claim called https://schemas.microsoft.com/marketplace/2015/08/claims/key/userId which contains "the same value that you pass into the optional publisherUserId parameter."
- Is it only metadata, or does Microsoft enforce binding?
It's metadata only - the publisherUserId does NOT enforce any binding between the Store customer and your ID. The documentation explicitly states:
"An anonymous ID that identifies the current user in the context of services that you manage as the publisher of the current app. If you maintain user IDs in the context of your services, you can use this parameter to associate your ID for the current user with the new Microsoft Store ID key (the user ID will be embedded in the key). Otherwise, if you don't need to associate a user ID with the Microsoft Store ID key, you can pass any string value."
The point is: Microsoft always returns a Collections ID key for the signed-in Store account, completely independent of what you pass as publisherUserId. Microsoft doesn't validate or enforce that the publisherUserId matches the Store customer - it simply embeds your value in the token for your own tracking purposes.
- Does the association persist after key renewal (~30 days)?
No, the association does not automatically persist. When you renew the key (after ~30 days), you would need to pass the same publisherUserId again if you want it embedded in the new key. The publisherUserId is only embedded in the specific JWT token you're creating - it's not stored separately by Microsoft to be automatically reapplied on renewal.
I hope this clarifies.