{"id":15788091,"url":"https://github.com/mevdschee/aspnetcookie","last_synced_at":"2025-03-31T18:23:32.597Z","repository":{"id":151764544,"uuid":"74115047","full_name":"mevdschee/aspnetcookie","owner":"mevdschee","description":"A Go package that can decode an ASP.net FormsAuthentication encrypted cookie.","archived":false,"fork":false,"pushed_at":"2017-06-26T20:45:10.000Z","size":9,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-04T21:41:18.177Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mevdschee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-11-18T09:27:17.000Z","updated_at":"2022-04-27T19:49:15.000Z","dependencies_parsed_at":"2023-07-30T18:01:15.033Z","dependency_job_id":null,"html_url":"https://github.com/mevdschee/aspnetcookie","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mevdschee%2Faspnetcookie","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mevdschee%2Faspnetcookie/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mevdschee%2Faspnetcookie/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mevdschee%2Faspnetcookie/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mevdschee","download_url":"https://codeload.github.com/mevdschee/aspnetcookie/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246515797,"owners_count":20790118,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-04T21:40:54.849Z","updated_at":"2025-03-31T18:23:32.566Z","avatar_url":"https://github.com/mevdschee.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/mevdschee/aspnetcookie.svg)](https://travis-ci.org/mevdschee/aspnetcookie)\n[![Coverage Status](https://coveralls.io/repos/github/mevdschee/aspnetcookie/badge.svg?branch=master)](https://coveralls.io/github/mevdschee/aspnetcookie?branch=master)\n\n# aspnetcookie\n\nA Go package that can decode and validate an ASP.net FormsAuthentication encrypted and signed cookie.\n\n## Limitations\n\nCurrently only the following (Web.config) configuration is tested:\n\n```\n\u003cmachineKey\n    validationKey=\"2E502E08392C704E2234759EDA7A5940A8CE1C42C7964B8142778764CF0006C2\"\n    decryptionKey=\"5226859B3CB262982B574093B29DAD9083030C93604C820F009D5192BDEC31F2\"\n    validation=\"SHA1\"\n    decryption=\"AES\"\n    compatibilityMode=\"Framework20SP2\"\n/\u003e\n```\n\nOnly SHA1 based HMAC and AES encryption are currently supported.\n\n## Usage\n\n```\nvalidationKey, _ := hex.DecodeString(\"2E502E08392C704E2234759EDA7A5940A8CE1C42C7964B8142778764CF0006C2\")\ndecryptionKey, _ := hex.DecodeString(\"5226859B3CB262982B574093B29DAD9083030C93604C820F009D5192BDEC31F2\")\ncodec := aspnetcookie.New(\"SHA1\", validationKey, \"AES\", decryptionKey)\ncookie, _ := codec.EncodeNew(\"maurits.vanderschee\", 3600*24*365, true, \"\\\"nothing\\\"\", \"/\")\nticket, _ := codec.Decode(cookie)\n```\t\n\nwhere ticket is:\n\n```\n// FormsAuthenticationTicket holds:\ntype FormsAuthenticationTicket struct {\n\tversion           byte\n\tname              string\n\tissueDateUtc      int64\n\texpirationDateUtc int64\n\tisPersistent      bool\n\tuserData          string\n\tcookiePath        string\n}\n```\n\n## Links\n\nsee: https://referencesource.microsoft.com/#System.Web/Security/FormsAuthentication.cs\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmevdschee%2Faspnetcookie","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmevdschee%2Faspnetcookie","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmevdschee%2Faspnetcookie/lists"}