I’m prob missing a fundamental understanding of NFT’s (on IC)! But is it possible to display NFT’s that a user owns in my app (that uses II)?
Perhaps querying canisters that hold the NFT registry and asset data, filtering by the owner’s PID, and then retrieving the necessary information to display the NFTs in my application?
If you are using the v2 version, it looks like these functions would help:
dip721_owner_token_metadata - This function seems to query the metadata of tokens owned by a specific owner. dip721_owner_token_identifiers - This function seems to query the identifiers of tokens owned by a specific principal.
To clarify, yes, the principal that is used to connect to Internet Identity on the frontend will be different from the identity of the user who owns the NFTs.
You could ask the user to input the principal that they used to purchase the NFT. This would “reveal” the identity of the user.
As an alternative, you could not use Internet Identity as an authentication. You could require the user to authenticate with the same wallet as they used to get the NFT (ex. Plug).