{"id":15596495,"url":"https://github.com/gobeam/golang-oauth","last_synced_at":"2026-03-27T03:09:21.709Z","repository":{"id":48426805,"uuid":"174334257","full_name":"gobeam/golang-oauth","owner":"gobeam","description":"Build your own Golang custom Oauth server with mysql driver.","archived":false,"fork":false,"pushed_at":"2021-07-26T23:37:25.000Z","size":171,"stargazers_count":15,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-01-12T00:31:09.968Z","etag":null,"topics":["encrypt","go-oauth2-server","golang","gooauth2","jwt","mysql","oaep","oauth2","rsa","rsa-pubkey"],"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/gobeam.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":"2019-03-07T11:48:16.000Z","updated_at":"2025-09-04T15:29:30.000Z","dependencies_parsed_at":"2022-09-26T18:00:32.159Z","dependency_job_id":null,"html_url":"https://github.com/gobeam/golang-oauth","commit_stats":null,"previous_names":["gobeam/gooauth2","roshanr83/gooauth2"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/gobeam/golang-oauth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gobeam%2Fgolang-oauth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gobeam%2Fgolang-oauth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gobeam%2Fgolang-oauth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gobeam%2Fgolang-oauth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gobeam","download_url":"https://codeload.github.com/gobeam/golang-oauth/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gobeam%2Fgolang-oauth/sbom","scorecard":{"id":432912,"data":{"date":"2025-08-11","repo":{"name":"github.com/gobeam/golang-oauth","commit":"0ae9f9e3b321bd35a2deec21068e573b641b3a8e"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.6,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: containerImage not pinned by hash: example/docker/db/Dockerfile:1: pin your Docker image by updating mariadb to mariadb@sha256:b30cc65b57a11a2e791ad5c06284e599fe9f1bf3fe9081a88d85bcf36389be4a","Warn: containerImage not pinned by hash: example/docker/service/Dockerfile:1: pin your Docker image by updating iron/base to iron/base@sha256:81f97f851059d087c64de5b7921da38383681224ac701a25bd9b8271f34a4d81","Info:   0 out of   2 containerImage dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Vulnerabilities","score":0,"reason":"13 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2021-0052 / GHSA-h395-qcrw-5vmq","Warn: Project is vulnerable to: GHSA-3vp4-m3rf-835h","Warn: Project is vulnerable to: GO-2023-1737 / GHSA-2c4m-59x9-fr2g","Warn: Project is vulnerable to: GO-2021-0227 / GHSA-3vm4-22fp-5rfm","Warn: Project is vulnerable to: GO-2022-0968 / GHSA-gwc9-m7rh-j2ww","Warn: Project is vulnerable to: GO-2021-0356 / GHSA-8c26-wmh5-6g9v","Warn: Project is vulnerable to: GO-2024-2961","Warn: Project is vulnerable to: GO-2023-2402 / GHSA-45x7-px36-x8w8","Warn: Project is vulnerable to: GO-2024-3321 / GHSA-v778-237x-gjrc","Warn: Project is vulnerable to: GO-2025-3487 / GHSA-hcg3-q754-cr77","Warn: Project is vulnerable to: GO-2022-0229 / GHSA-cjjc-xp8v-855w","Warn: Project is vulnerable to: GO-2020-0012 / GHSA-ffhg-7mh4-33c4","Warn: Project is vulnerable to: GO-2022-0493 / GHSA-p782-xgp4-8hr8"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T03:47:50.354Z","repository_id":48426805,"created_at":"2025-08-19T03:47:50.354Z","updated_at":"2025-08-19T03:47:50.354Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31013961,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-27T02:58:54.984Z","status":"ssl_error","status_checked_at":"2026-03-27T02:58:46.993Z","response_time":164,"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":["encrypt","go-oauth2-server","golang","gooauth2","jwt","mysql","oaep","oauth2","rsa","rsa-pubkey"],"created_at":"2024-10-03T01:05:04.290Z","updated_at":"2026-03-27T03:09:21.686Z","avatar_url":"https://github.com/gobeam.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Golang Oauth 2.0  with JWT custom server with example\n[![Build][Build-Status-Image]][Build-Status-Url] [![Go Report Card](https://goreportcard.com/badge/github.com/gobeam/golang-oauth?branch=master)](https://goreportcard.com/report/github.com/gobeam/golang-oauth) [![GoDoc][godoc-image]][godoc-url]\nBuild your own Golang custom Oauth 2.0 server. This package helps you to develop your own custom oauth2 server. With lots of scaffolding done for you you can easily implement your own logic without any hassle.\n\u003cbr\u003e\nOfficial docs: [Here](https://godoc.org/github.com/gobeam/golang-oauth)\n\n* [Why?](#why)\n* [Example](#example)\n* [Installation](#installation)\n* [Initialization](#initialization)\n* [Create Client](#create-client)\n* [Create Access Token](create-access-token)\n* [Revoke Access/Refresh Token manually](#revoke-accessrefresh-token-manually)\n* [Clear All Access Token Of User](#clear-all-access-token-of-user)\n* [Running the tests](#running-the-tests)\n* [Contributing](#contributing)\n* [License](#license)\n\n\n## Why\nI was trying to make my own modified version of OAUTH2 alongside with JWT server and didn't find any good package so, I made one.  This project is modified version of [go-oauth2/oauth2](https://github.com/go-oauth2/oauth2). since this project didn't meet my requirement .\n\u003cbr\u003e\nThis package uses \u003cb\u003eEncryptOAEP\u003c/b\u003e which encrypts the given data with \u003cb\u003eRSA-OAEP\u003c/b\u003e to encrypt token data. Two separate file \u003cb\u003eprivate.pem\u003c/b\u003e and \u003cb\u003epublic.pem\u003c/b\u003e file will be created on your root folder which includes respective private and public RSA keys which is used for encryption.\n\u003cbr\u003e\n\n\n## Example\nFor easy scaffold and full working REST API example made with framework [gin-gonic/gin](https://github.com/gin-gonic/gin) is included in  [example](https://github.com/gobeam/golang-oauth/tree/master/example) implementing this package.\n[Postman Collection](https://github.com/gobeam/golang-oauth/blob/master/example/third_party/postman_import/postman.json)\n\n## Installation\n\n``` bash\n$ go get -u -v github.com/gobeam/golang-oauth\n```\n\n\n## Initialization\n\nEasy to initialize just by:\n\n``` go\npackage main\n\nimport (\n\t_ \"github.com/go-sql-driver/mysql\"\n\toauth \"github.com/roshanr83/go-oauth2\"\n)\n\nfunc main() {\n\t//register store\n\tstore := oauth.NewDefaultStore(\n\t\toauth.NewConfig(\"root:root@tcp(127.0.0.1:8889)/goauth?charset=utf8\u0026parseTime=True\u0026loc=Local\"),\n\t)\n\tdefer store.Close()\n}\n\n```\n\n\n## Create Client\n\nTo create client where 1 is user ID Which will return Oauth Clients struct which include client id and secret which is later used to validate client credentials\n\t \n```go\n var userId = 1 // to know who created can be 0\n var clientName = \"my app\" // app name can be empty string\n store.CreateClient(userId, clientName)\n\n```\n\n\n## Create Access Token\nVisit [oauthMiddleware.go](https://github.com/gobeam/golang-oauth/blob/master/example/middlewares/oauthMiddleware.go) to get full example on how to handle creating access token and refresh token. \n\n\n## Revoke Access/Refresh Token manually\n\n```go\n  /*You can manually revoke access token by passing\n  userId which you can get from valid token info */\n  store.RevokeByAccessTokens(userId) \n  \n  /*You can manually revoke refresh token by passing\n  accessTokenId which you can get from valid token info */\n  store.RevokeRefreshToken(accessTokenId)\n\n```\n\n\n## Clear All Access Token Of User\n\n```go\n  /* you can also clear all token related to\n  user by passing TokenInfo from valid token */\n  store.ClearByAccessToken(userId)\n```\n\n\n## Running the tests\n\nDatabase config is used as \"root:root@tcp(127.0.0.1:3306)/goauth?charset=utf8\u0026parseTime=True\u0026loc=Local\" in const.go file, You may have to change that configuration according to your system config for successful test.\n\n``` bash\n$ go test\n```\n\n\n## Contributing\n\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\nPlease make sure to update tests as appropriate.\n\n\n## License\n\nReleased under the MIT License - see `LICENSE.txt` for details.\n\n\n[Build-Status-Url]: https://travis-ci.org/gobeam/golang-oauth\n[Build-Status-Image]: https://travis-ci.org/gobeam/golang-oauth.svg?branch=master\n[godoc-url]: https://pkg.go.dev/github.com/gobeam/golang-oauth?tab=doc\n[godoc-image]: https://godoc.org/github.com/gobeam/golang-oauth?status.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgobeam%2Fgolang-oauth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgobeam%2Fgolang-oauth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgobeam%2Fgolang-oauth/lists"}