{"id":36532847,"url":"https://github.com/fmorenovr/gojwt","last_synced_at":"2026-01-27T09:48:35.020Z","repository":{"id":57516974,"uuid":"107567701","full_name":"fmorenovr/gojwt","owner":"fmorenovr","description":"goJweto (Golang JSON Web Token) is a Golang implementation for REST service security.","archived":false,"fork":false,"pushed_at":"2019-08-19T17:36:26.000Z","size":62,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-01-12T05:37:13.656Z","etag":null,"topics":["golang","golang-package","jwt","jwt-auth","jwt-authentication","jwt-go","jwt-middleware","jwt-server","jwt-token","jwt-tokens"],"latest_commit_sha":null,"homepage":"https://godoc.org/github.com/fmorenovr/gojwt","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/fmorenovr.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}},"created_at":"2017-10-19T15:53:38.000Z","updated_at":"2019-08-19T17:37:13.000Z","dependencies_parsed_at":"2022-09-26T20:00:50.000Z","dependency_job_id":null,"html_url":"https://github.com/fmorenovr/gojwt","commit_stats":null,"previous_names":["jenazads/gojwt","jenazads/gojweto"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fmorenovr/gojwt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmorenovr%2Fgojwt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmorenovr%2Fgojwt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmorenovr%2Fgojwt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmorenovr%2Fgojwt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fmorenovr","download_url":"https://codeload.github.com/fmorenovr/gojwt/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmorenovr%2Fgojwt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28811480,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T07:41:26.337Z","status":"ssl_error","status_checked_at":"2026-01-27T07:41:08.776Z","response_time":168,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["golang","golang-package","jwt","jwt-auth","jwt-authentication","jwt-go","jwt-middleware","jwt-server","jwt-token","jwt-tokens"],"created_at":"2026-01-12T03:03:19.383Z","updated_at":"2026-01-27T09:48:35.000Z","avatar_url":"https://github.com/fmorenovr.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# golang + JWT = goJwt (GoJweto)\n\ngoJwt (Golang for JSON Web Token) is a Golang implementation for REST service security.  \nYou can see an extended doc in [godocs](https://godoc.org/github.com/fmorenovr/gojwt).\n\n## JWT\n\nJWT (JSON Web Token) is a standard to make secure a connection in a compact URL-safe means of representing claims to be transferred between two parties.  \nSee more info [here](https://jwt.io).\n\n## goJwt\n\n* First, You should create your RSA key pairs.  \n  Create `/tls-ssl/jwtkeys/` directory in your root path of your project:\n\n      cd jwt/keys\n      openssl genrsa -out rsakey.pem 2048\n      openssl rsa -in rsakey.pem -pubout \u003e rsakey.pem.pub\n\n* Or You should create your ECDSA key pairs.  \n  Create `/tls-ssl/jwtkeys/` directory in your root path of your project:\n\n    * First, select a curve list:\n    \n          openssl ecparam -list_curves\n\n    * Then, select secp256r1 or secp384r1:\n\n          cd jwt/keys\n          openssl ecparam -genkey -name secp384r1 | sed -e '1,3d' \u003e ecdsakey.pem\n          openssl ec -in ecdsakey.pem -pubout \u003e ecdsakey.pem.pub\n\n* Next, You should download my library:\n\n      go get github.com/fmorenovr/gojwt/\n\n* Then, you should use for differents implements in Go.\n        \n    * First, Create a HMAC_SHA gojwt object, specifying nameServer, headerAuth in request, secretKey, bytes, and expiration time (in hours).\n    \n            var GojwtObject, _ = gojwt.NewGojwtHMAC_SHA(\"JnzadsServer\", \"jnzads-rest\", \"Jnzads-rest-JWT\", \"512\", 24)\n    \n    * Or a RSA/ECDA Object, specifying nameServer, headerAuth in request, privKeypath, pubKeyPath, bytes, and expiration time (in hours).\n    \n            var GojwtObject, _ = gojwt.NewGojwtRSA(\"JnzadsServer\", \"Jnzads-rest-JWT\", privKeyPath, pubKeyPath, \"384\", 24)\n            var GojwtObject, _ = gojwt.NewGojwtECDSA(\"JnzadsServer\", \"Jnzads-rest-JWT\", privKeyPath, pubKeyPath, \"256\", 24)\n    \n        \n    * Then, generate the token string specifyind a nameserver and username:\n      \n            tokenString, _ := GojwtObject.CreateToken(Username)\n\n    * Using in Go net/http package:\n      \n      * Add `examples/goJwtHandler.go` in your controllers directory.\n      \n      * Then, in your muxServe add:\n      \n        ```go\n          muxHttp.HandleFunc(\"/setToken\", setTokenHandler)\n          muxHttp.HandleFunc(\"/login\", LoginHandler)\n          muxHttp.HandleFunc(\"/profile\", gojwt.MiddlewareGojwtHeaders(WithAuthHandler, NoAuthHandler))\n        ```\n\n    * Using in BeeGo:\n    \n      * Add `examples/goJwtBeeGoController.go` in your controllers directory.\n        \n      * And, in other controllers, add your new controller instead beegoController.\n      \n        ```go\n            import (\n              \"encoding/json\";\n              \"restfulapi-beego/models\";\n              //\"github.com/astaxie/beego\";\n            )\n\n            type AlertController struct {\n\t            //beego.Controller\n\t            GoJwtController\n            }\n        ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffmorenovr%2Fgojwt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffmorenovr%2Fgojwt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffmorenovr%2Fgojwt/lists"}