{"id":"4ba0802ad912f1f7","repo":"docker/cli","slug":"failed-to-parse-token-claims-w","errorCode":null,"errorMessage":"failed to parse token claims: %w","messagePattern":"failed to parse token claims: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/oauth/manager/manager.go","lineNumber":139,"sourceCode":"\tgo func() {\n\t\treader := bufio.NewReader(os.Stdin)\n\t\t_, _ = reader.ReadString('\\n')\n\t\t_ = m.openBrowser(state.VerificationURI)\n\t}()\n\n\t_, _ = fmt.Fprint(w, \"\\nWaiting for authentication in the browser…\\n\")\n\tvar tokenRes api.TokenResponse\n\tselect {\n\tcase <-ctx.Done():\n\t\treturn nil, errors.New(\"login canceled\")\n\tcase err := <-waitForTokenErrChan:\n\t\treturn nil, fmt.Errorf(\"failed waiting for authentication: %w\", err)\n\tcase tokenRes = <-tokenResChan:\n\t}\n\n\tclaims, err := oauth.GetClaims(tokenRes.AccessToken)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to parse token claims: %w\", err)\n\t}\n\n\terr = m.storeTokensInStore(tokenRes, claims.Domain.Username)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to store tokens: %w\", err)\n\t}\n\n\tpat, err := m.api.GetAutoPAT(ctx, m.audience, tokenRes)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &types.AuthConfig{\n\t\tUsername:      claims.Domain.Username,\n\t\tPassword:      pat,\n\t\tServerAddress: registry.IndexServer,\n\t}, nil\n}","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/internal/oauth/manager/manager.go#L121-L157","documentation":"Error \"failed to parse token claims: %w\" thrown in docker/cli.","triggerScenarios":"Thrown at internal/oauth/manager/manager.go:139 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"e9452d6e785f6e365712b9d71bd7517591773c86","analyzedAt":"2026-08-01T07:09:22.474Z","schemaVersion":2}