{"id":38862906,"url":"https://github.com/johansetia/jowt","last_synced_at":"2026-01-17T14:23:17.500Z","repository":{"id":57517462,"uuid":"204646599","full_name":"johansetia/jowt","owner":"johansetia","description":"JOWT is a simple package for golang to generate and verify JWT token","archived":false,"fork":false,"pushed_at":"2020-07-26T15:43:00.000Z","size":21,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-15T11:21:43.243Z","etag":null,"topics":["golang","golang-package","golang-tools","jwt","jwt-authentication","jwt-token"],"latest_commit_sha":null,"homepage":"","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/johansetia.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":"security.go","support":null}},"created_at":"2019-08-27T07:33:13.000Z","updated_at":"2019-09-03T02:52:09.000Z","dependencies_parsed_at":"2022-09-06T08:41:54.141Z","dependency_job_id":null,"html_url":"https://github.com/johansetia/jowt","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/johansetia/jowt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johansetia%2Fjowt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johansetia%2Fjowt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johansetia%2Fjowt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johansetia%2Fjowt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johansetia","download_url":"https://codeload.github.com/johansetia/jowt/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johansetia%2Fjowt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28509945,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T13:38:16.342Z","status":"ssl_error","status_checked_at":"2026-01-17T13:37:44.060Z","response_time":85,"last_error":"SSL_read: 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","golang-tools","jwt","jwt-authentication","jwt-token"],"created_at":"2026-01-17T14:23:17.434Z","updated_at":"2026-01-17T14:23:17.484Z","avatar_url":"https://github.com/johansetia.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JOWT (JWT Simple Package for Golang)\n[![GoDoc](https://godoc.org/github.com/johansetia/jowt?status.svg)](https://godoc.org/github.com/johansetia/jowt)\n[![Go Report Card](https://goreportcard.com/badge/github.com/johansetia/jowt)](https://goreportcard.com/report/github.com/johansetia/jowt)\n[![Build Status](https://travis-ci.org/johansetia/jowt.svg?branch=master)](https://travis-ci.org/johansetia/jowt)\n[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/3126/badge)](https://bestpractices.coreinfrastructure.org/projects/3126)\n\nJOWT is a Simple Package for Golang to generate and verify JWT Token using HMAC + RSA256 OR RSA512.\n\n## \n## How to Install ?\n```bash\n$ go get github.com/johansetia/jowt\n```\n## How to Use ?\n### 1. Importing Package\n```go\npackage main\n\nimport (\n    \"github.com/johansetia/jowt\"\n)\n```\n### 2. Make a Payload and Key\nyou can use a structure from this package to create payload data.\n```go\nkey := \"qwertyuiopasdfghjklzxcvbnm123456\"\ndata := jowt.Payload{\n\t\"iss\": \"johan.com\",\n        \"iat\": 1566959060,\n        \"exp\": 1598495060,\n        \"aud\": \"www.johan.com\",\n        \"sub\": \"admin@johan.com\",\n        \"UserName\": \"Johan\",\n        \"Email\": \"johan@example.com\",\n        \"userData\": jowt.Payload{\n                \"Level\":     \"Administrator\",\n                \"Role\":      \"UserAdministrator\",\n            },\n\t}\n```\n### 3. Getting value\nUsing **HS512 Function** to get a JWT Token\n```go\n    token, ok := jowt.HS512(key).SetPayload(dataPayload).Get()\n    if !ok {\n        panic(\"ERROR GET TOKEN\")\n    }\n    fmt.Println(token)\n    \n```\nYour HS512 token is \n```\neyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJFbWFpbCI6ImpvaGFuQGV4YW1wbGUuY29tIiwiVXNlck5hbWUiOiJKb2hhbiIsImF1ZCI6Ind3dy5qb2hhbi5jb20iLCJleHAiOjE1OTg0OTUwNjAsImlhdCI6MTU2Njk1OTA2MCwiaXNzIjoiam9oYW4uY29tIiwic3ViIjoiYWRtaW5Aam9oYW4uY29tIiwidXNlckRhdGEiOnsiTGV2ZWwiOiJBZG1pbmlzdHJhdG9yIiwiUm9sZSI6IlVzZXJBZG1pbmlzdHJhdG9yIn19.M1xhZDFeXwWj9dxVyMYGBgZ45NFqVobe8ZoPm6JVDBjSc6TSQCA-Ja9_DnIqzhNP1JMCMCdam5SIY6xn5ijLIw\n```\nUsing **HS256 Function** to get a JWT Token\n```go\n    token, ok := jowt.HS256(key).SetPayload(dataPayload).Get()\n    if !ok {\n        panic(\"ERROR GET TOKEN\")\n    }\n    fmt.Println(token)\n    \n```\nYour HS256 token is \n```\neyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJFbWFpbCI6ImpvaGFuQGV4YW1wbGUuY29tIiwiVXNlck5hbWUiOiJKb2hhbiIsImF1ZCI6Ind3dy5qb2hhbi5jb20iLCJleHAiOjE1OTg0OTUwNjAsImlhdCI6MTU2Njk1OTA2MCwiaXNzIjoiam9oYW4uY29tIiwic3ViIjoiYWRtaW5Aam9oYW4uY29tIiwidXNlckRhdGEiOnsiTGV2ZWwiOiJBZG1pbmlzdHJhdG9yIiwiUm9sZSI6IlVzZXJBZG1pbmlzdHJhdG9yIn19.yoFC0whrAh80A0bc7bGMlDR3XRW_dL-YwwEXQ3qRlJQ\n```\n\n### 4. Verify your JWT using key\n```go\n    verify := jowt.Verify(key).SetToken(jwt).Status()\n    if verify {\n        fmt.Println(\"USER ACCEPTED\")\n    }else{\n        fmt.Println(\"USER DECIDED\")\n    }\n```\n## Structure\n```bash\n.\n├── example\n│   ├── go.mod\n│   ├── go.sum\n│   ├── main.go\n│   └── README.md\n├── go.mod\n├── helper\n│   └── helper.go\n├── jowt.go\n├── LICENSE\n├── README.md\n└── security.go\n\n2 directories, 10 files\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohansetia%2Fjowt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohansetia%2Fjowt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohansetia%2Fjowt/lists"}