Skip to content

Use gRPC server to validate NEX token instead of local validation#61

Open
jonbarrow wants to merge 5 commits intomainfrom
feat/grpc-token
Open

Use gRPC server to validate NEX token instead of local validation#61
jonbarrow wants to merge 5 commits intomainfrom
feat/grpc-token

Conversation

@jonbarrow
Copy link
Member

@jonbarrow jonbarrow commented Jan 17, 2026

Resolves #XXX

Changes:

Makes the following changes:

  • Uses gRPC to contact the account server to validate NEX tokens, instead of manually parsing them. This helps future-proof the servers in case of token changes and lets us revoke tokens and such
  • Renames ValidatePretendoLoginData to ValidateNEXLoginData for clarity on what kind of data is being validated (and also removes the branding issue of not having "Network" in the name, without making the function name too long)
  • Renames SetPretendoValidation to SetGameServerID for clarity on what the value is that's actually being set. The game server ID is tied to tokens on the account server, so sending it allows the account server to know that the token was issued for the requesting game server
    • Note 1: The current account server implementation does not check the game server ID just to make things simple for now, however this will likely come sooner than later once we implement things like per-game bans
    • Note 2: I did mess up a bit however and made it so the gRPC server can only recieve one game server ID and the NEX token exchange endpoint doesn't allow the client to send title IDs. This means certain games which share a game server, but not necessarily the same game server ID (such as Pokemon) will have issues unless we either split the server, change the gRPC server to allow title IDs, or change the gRPC server to allow multiple game server IDs (either by changing the protocols or by allowing the single field to contain multiple game server IDs, like ID1,ID2,ID3 and the server splits them). Changing the gRPC protobufs to allow multiple game server IDs is the cleanest option imo, and I would prefer making it a real array field, but keeping it as a single string that gets split on the server is also fine and would mean less API changes

Do not merge this yet even if approved. Needs PretendoNetwork/account#313 to be both merged AND deployed to work

@jonbarrow jonbarrow requested a review from DaniElectra January 21, 2026 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants