Bungie-net / api

Resources for the Bungie.net API
Other
1.21k stars 92 forks source link

Missing Destiny membership for user #1398

Closed Aioros closed 3 years ago

Aioros commented 3 years ago

I have an unexpected situation with some users of my app, where /User/GetMembershipsById/ is returning an empty destinyMemberships array. Here's an example:

    {
        "destinyMemberships": [],
        "bungieNetUser": {
            "membershipId": "6736624",
            "uniqueName": "6736624",
            "displayName": "SpiniestGnu40",
            //...
            "successMessageFlags": "32",
            "isDeleted": false,
            //...
            "firstAccess": "2014-09-15T03:36:25.027Z",
            "lastUpdate": "2021-01-15T20:44:04.305Z",
            //...
            "showActivity": true,
            //...
        }
    }

Normally, I would consider this to be a Bungie.net user with no Destiny accounts linked. However, the user provided me with a screenshot of his profile, showing that he has a linked Xbox account (and also that he authorized my app).

If I search for that Xbox user I can find it, but it doesn't show any associated BungieNext membership. This makes it impossible for me to link the original BungieNext id that I get from the auth process to the Destiny account. Any idea what I might be missing?

jshaffstall-bng commented 3 years ago

It looks like that Destiny account linking is hidden from unauthenticated requests. For example, if you visit that profile page while not signed into Bungie.net, you won't see the Xbox account there - https://www.bungie.net/en/Profile/254/6736624/SpiniestGnu40

As a workaround, you could use OAuth to authenticate with your Bnet account, and then make those requests with your app.

Aioros commented 3 years ago

Thank you for the reply, John. It doesn't seem that I can see their linked account while using my own credentials, so I assume that I would need to use the user's access token in my request.

jshaffstall-bng commented 3 years ago

Now that I'm reading this again more closely, you could ask this user to display the Xbox account publicly, in the Accounts & Linking settings on Bungie.net.