Sharing IdTokenJWT in P2P mode could allow impersonation, no?

Hi,

I was looking at the Anti-Cheat sample, more precisely at the P2P implementation, and it seems that one user sends their ProductUserId & IdTokenJWT to other user. The second user verifies it, using EOS_Connect_VerifyIdToken.

Wouldn’t that allow the user receiving this information to impersonate the user sending it? At least, from the content of the token, I don’t think anything would prevent that.

It seems that the better implementation would have to have a trusted service to check this value and confirm to the peer the validity. It’s a bit trickier to implement, especially in a sample, but if my previous understanding is correct, I think the current example is not good to follow.

Cheers

Hello, CopyIdToken returns an ID token, not an access token. Here’s a good comparison between ID and access tokens.

I don’t know if it would matter though.

Wouldn’t it be possible to have the following.

  1. Player 1 host a P2P game, receive the ProductUserId & IdTokenJWT from Player 2.
  2. Player 1 leaves and joins the game of Player 3, sending the ProductUserId & IdTokenJWT of Player 2.
  3. Wouldn’t the Player 3 successfully verify the login data and believe Player 1 is Player 2?

In this case, Player1 would get kicked from the protected session, assuming anti-cheat is implemented correctly. The reason is that peer-to-peer messaging wouldn’t be working correctly. For a player to remain in a session, they must send messages to one another, triggered by notifications from our backend. The messaging flow is explained here.

Ok, make sense.

Thanks a lot for the answers.