{"id":18171327,"url":"https://github.com/rgglez/gofiber-zitadel-middleware","last_synced_at":"2026-03-04T07:02:23.973Z","repository":{"id":260419412,"uuid":"881145282","full_name":"rgglez/gofiber-zitadel-middleware","owner":"rgglez","description":"Middleware to use along with the Zitadel IDP","archived":false,"fork":false,"pushed_at":"2026-02-27T05:22:49.000Z","size":75,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-27T09:09:41.090Z","etag":null,"topics":["authentication","authentication-middleware","go","gofiber","idp","jwt","middleware","oidc","zitadel"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rgglez.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,"zenodo":null}},"created_at":"2024-10-31T01:32:57.000Z","updated_at":"2026-02-27T05:22:53.000Z","dependencies_parsed_at":"2024-12-20T20:53:49.948Z","dependency_job_id":"353bf642-cd4c-4b90-8479-e84165cd5c5f","html_url":"https://github.com/rgglez/gofiber-zitadel-middleware","commit_stats":{"total_commits":34,"total_committers":2,"mean_commits":17.0,"dds":0.2941176470588235,"last_synced_commit":"f0d8eb3a5b02220fabb645264092b1d25210b91d"},"previous_names":["rgglez/gofiber-zitadel-middleware"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rgglez/gofiber-zitadel-middleware","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgglez%2Fgofiber-zitadel-middleware","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgglez%2Fgofiber-zitadel-middleware/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgglez%2Fgofiber-zitadel-middleware/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgglez%2Fgofiber-zitadel-middleware/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rgglez","download_url":"https://codeload.github.com/rgglez/gofiber-zitadel-middleware/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgglez%2Fgofiber-zitadel-middleware/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30075425,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T05:31:57.858Z","status":"ssl_error","status_checked_at":"2026-03-04T05:31:38.462Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["authentication","authentication-middleware","go","gofiber","idp","jwt","middleware","oidc","zitadel"],"created_at":"2024-11-02T15:08:41.952Z","updated_at":"2026-03-04T07:02:23.950Z","avatar_url":"https://github.com/rgglez.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gofiber-zitadel-middleware\n\n[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n![GitHub all releases](https://img.shields.io/github/downloads/rgglez/gofiber-zitadel-middleware/total)\n![GitHub issues](https://img.shields.io/github/issues/rgglez/gofiber-zitadel-middleware)\n![GitHub commit activity](https://img.shields.io/github/commit-activity/y/rgglez/gofiber-zitadel-middleware)\n[![Go Report Card](https://goreportcard.com/badge/github.com/rgglez/gofiber-zitadel-middleware)](https://goreportcard.com/report/github.com/rgglez/gofiber-zitadel-middleware)\n[![GitHub release](https://img.shields.io/github/release/rgglez/gofiber-zitadel-middleware.svg)](https://github.com/rgglez/gofiber-zitadel-middleware/releases/)\n![GitHub stars](https://img.shields.io/github/stars/rgglez/gofiber-zitadel-middleware?style=social)\n![GitHub forks](https://img.shields.io/github/forks/rgglez/gofiber-zitadel-middleware?style=social)\n\n**gofiber-zitadel-middleware** is a [gofiber](https://gofiber.io/) [middleware](https://docs.gofiber.io/category/-middleware/) to be used along with the [Zitadel](https://zitadel.com/) (and perhaps other [OIDC](https://auth0.com/es/intro-to-iam/what-is-openid-connect-oidc) servers) security manager to verify the [JWT token](https://jwt.io/) provided by it in the corresponding flows.\n\n## Installation\n\n```bash\ngo get github.com/rgglez/gofiber-zitadel-middleware\n```\n\n## Usage\n\n```go\nimport gofiberzitadel \"github.com/rgglez/gofiber-zitadel-middleware/gofiberzitadel\"\n\n// Initialize Fiber app and middleware\napp := fiber.New()\napp.Use(gofiberzitadel.New(gofiberzitadel.Config{ProviderUrl: providerUrl, ClientID: clientId}))\n```\n\n## Configuration\n\nThere are some configuration options available in the ```Config``` struct:\n\n* **```Next```** defines a function to skip this middleware when returned true. Optional. Default: nil\n* **```ProviderUrl```** a string which defines the URL of the Zitadel instance. Required.\n* **```ClientID```** a string which defines the ```client_id``` of the application to be used in the validation. Required.\n* **```StoreClaimsIndividually```** a boolean which defines if the claims should be stored as key:value pairs in the fiber context. Optional. Default: false.\n\n## Notes\n\n* The whole claims are stored in the fiber context as \"claims\" by default. \n\n## Example\n\nAn example is provided in the [example/](example/) directory.\n\n### Run it\n\n```bash\ncd example\ngo run main.go\n```\n\n### Try it\n\nThen, if it started correctly, assuming that you filled the enviroment variables in ```test_data.sh``` . Or, just set the same variables explained in the Testing section.\n\n```bash\n# first step is optional\nsource /path/to/test_data.sh\n```\n\nYou will need [pytest](https://en.wikipedia.org/wiki/Pytest) tu run the test:\n\n```bash\ncd tests\npytest\n```\n\n## Testing\n\nA test is included. To run the test you must:\n\n1. Setup a working Zitadel instance, either self-hosted or SaaS. You will need the URL of this instance, as the **Provider URL**.\n1. Setup a Zitadel application in your instance. You will need the [**Client ID**](https://zitadel.com/docs/guides/manage/console/applications#application-settings) of this application.\n1. Create a human user and write down the user's **name**. You will need it for the assertion of the claims.\n1. Optionally, create an application which will be using the Zitadel provider for authentication. You can use [this](https://github.com/rvs1257/svelte-zitadel-pkce) Svelte application as the basis. You will need to login into a real or sample application in order to get the **```id_token```** field from the JSON returned by the ```/token``` endpoint.\nOtherwise you would need to use the Zitadel API to get this token manually.\n1. Set the test data in the enviroment. An example bash script is provided in [```test_data.sh```](test_data.sh) as a guide. You must fill in the values with your own data accordingly:\n\n    ```bash\n    # The full URL including trailing / of your Zitadel instance\n    export ZITADEL_PROVIDER=\n    # The client_id of the Zitadel application\n    export ZITADEL_CLIENTID=\n    # A token got from a valid login \n    export ZITADEL_TOKEN=\n    # The \"name\" of the logged user\n    export ZITADEL_NAME=\n    ```\n    If you use this script, you should need to [source](https://www.geeksforgeeks.org/source-command-in-linux-with-examples/) it.\n\n1. Run\n    ```bash\n    go test\n    ```\n    inside the [```gofiberzitadel/```](gofiberzitadel/) directory.\n\n## Dependencies\n\n* [github.com/coreos/go-oidc](https://github.com/coreos/go-oidc)\n* [github.com/gofiber/fiber/v2](https://github.com/gofiber/fiber/v2)\n\n## License\n\nCopyright (c) 2026 Rodolfo González González\n\nLicensed under the [Apache 2.0](LICENSE) license. Read the [LICENSE](LICENSE) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frgglez%2Fgofiber-zitadel-middleware","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frgglez%2Fgofiber-zitadel-middleware","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frgglez%2Fgofiber-zitadel-middleware/lists"}