{"record":{"id":"d4ab00f52ea756b7","repo":"Pumpkin-MC/Pumpkin","slug":"failed-to-decode-extra-using-decode-b64-url-nopad","errorCode":null,"errorMessage":"Failed to decode extra using decode_b64_url_nopad.","messagePattern":"Failed to decode extra using decode_b64_url_nopad\\.","errorType":"error_code","errorClass":"LoginError","httpStatus":null,"severity":"error","filePath":"crates/pumpkin/src/net/bedrock/login/mod.rs","lineNumber":44,"sourceCode":"use thiserror::Error;\nuse tracing::debug;\nuse uuid::Uuid;\n\n#[derive(Debug, Error)]\npub enum LoginError {\n    #[error(\"Login packet data is not valid JSON\")]\n    InvalidTokenFormat(#[from] serde_json::Error),\n    #[error(\"JWT chain validation failed: {0}\")]\n    ChainValidationFailed(#[from] AuthError),\n    #[error(\"The validated username is invalid\")]\n    InvalidUsername,\n    #[error(\"Could not parse UUID from validated token\")]\n    InvalidUuid,\n    #[error(\"Cannot accept self-signed token. Authentication is enforced by server config.\")]\n    SelfSignedNotAllowed,\n    #[error(\"Got a guest/splitscreen login request. Currently unimplemented.\")]\n    GuestUnimplemented,\n    #[error(\"Failed to decode extra using decode_b64_url_nopad.\")]\n    DecodeExtraError,\n}\n\n#[derive(Deserialize_repr)]\n#[repr(u8)]\nenum AuthenticationType {\n    Full,\n    Guest,\n    SelfSigned,\n}\n\n#[derive(Deserialize)]\n#[serde(rename_all = \"PascalCase\")]\nstruct AuthPayload {\n    authentication_type: AuthenticationType,\n    token: String,\n}\n","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/Pumpkin-MC/Pumpkin/blob/8d4639e25a57c15e47448ec327c780d41bbf2356/crates/pumpkin/src/net/bedrock/login/mod.rs#L26-L62","documentation":"LoginError variant raised when the base64 URL-encoded 'ExtraData' section of the Bedrock login token chain fails to decode with decode_b64_url_nopad, meaning the client's identity payload is corrupt or truncated.","triggerScenarios":"Thrown at crates/pumpkin/src/net/bedrock/login/mod.rs:44 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reject the login with an invalid-token kick message","Log the decode error at debug level","Check that the token uses unpadded base64url encoding"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8d4639e25a57c15e47448ec327c780d41bbf2356","analyzedAt":"2026-09-09T15:32:22.916Z","contentChangedAt":"2026-09-09T15:32:22.916Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}