close
Skip to content

Fix Education Edition support#336

Open
SendableMetatype wants to merge 1 commit into
CloudburstMC:3.0from
SendableMetatype:3.0
Open

Fix Education Edition support#336
SendableMetatype wants to merge 1 commit into
CloudburstMC:3.0from
SendableMetatype:3.0

Conversation

@SendableMetatype
Copy link
Copy Markdown

The library already maintains packets, data types, and fields for Education Edition, but Education clients can't actually use any of it because they desync on StartGamePacket before any subsequent packets can be exchanged. Education Edition's wire format has three extra string fields at the end of LevelSettings that the current serializer doesn't write, causing the client's deserializer to read into subsequent packet data and disconnect. This PR fixes the serialization and adds the auth utilities needed to verify Education login tokens.

Changes

Codec: Three new fields on StartGamePacket, an EducationStartGameSerializer_v898 extending the existing one, and Bedrock_v898.EDUCATION_CODEC as a parallel constant.

Auth: Education clients don't use Xbox Live. Their login chains are self-signed and validateChain always returns signed=false. This adds validation for Microsoft's education services (MESS) signed tokens and a createHandshakeJwt overload for the signedToken claim education clients require, following the existing patterns in EncryptionUtils.

When Education updates to a newer protocol version, adding support requires only a new serializer and EDUCATION_CODEC constant on that version's class.

I have detailed documentation on the Education Edition protocol differences and authentication system if needed.

- StartGamePacket: three Education-specific string fields after ownerId
  in LevelSettings, plus EducationStartGameSerializer_v898 to read/write
  them, plus EDUCATION_CODEC variant on Bedrock_v898
- EncryptionUtils: EDUCATION_PUBLIC_KEY trust anchor (Microsoft's MESS
  signing key), createHandshakeJwt overload embedding the signedToken
  claim, three-layer token validation API mirroring validatePayload
  (validateEducationPayload / extractServerTokenFromEduTokenChain /
  validateEducationToken)
- EducationTokenValidationResult value class with VALID/EXPIRED/INVALID
  status and tenantId/oid/expiry accessors
- Round-trip test for the Education StartGame serializer
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.

1 participant