{"id":16718374,"url":"https://github.com/tsileo/indieauth","last_synced_at":"2025-04-10T08:52:39.406Z","repository":{"id":57480183,"uuid":"126722983","full_name":"tsileo/indieauth","owner":"tsileo","description":"Implements an IndieAuth (an identity layer on top of OAuth 2.0) client/authentication middleware.","archived":false,"fork":false,"pushed_at":"2020-04-26T15:22:53.000Z","size":20,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T08:08:17.931Z","etag":null,"topics":["authentication-middleware","go","golang","indieauth","indieweb"],"latest_commit_sha":null,"homepage":"https://a4.io/go/indieauth","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/tsileo.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":"2018-03-25T17:38:43.000Z","updated_at":"2024-01-27T21:44:23.000Z","dependencies_parsed_at":"2022-09-18T05:48:46.865Z","dependency_job_id":null,"html_url":"https://github.com/tsileo/indieauth","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsileo%2Findieauth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsileo%2Findieauth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsileo%2Findieauth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsileo%2Findieauth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tsileo","download_url":"https://codeload.github.com/tsileo/indieauth/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247767250,"owners_count":20992541,"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":["authentication-middleware","go","golang","indieauth","indieweb"],"created_at":"2024-10-12T21:36:37.688Z","updated_at":"2025-04-10T08:52:39.386Z","avatar_url":"https://github.com/tsileo.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IndieAuth\n\n[![Build Status](https://d.a4.io/api/badges/tsileo/indieauth/status.svg)](https://d.a4.io/tsileo/indieauth)\n\u0026nbsp; \u0026nbsp;[![Godoc Reference](https://godoc.org/a4.io/go/indieauth?status.svg)](https://godoc.org/a4.io/go/indieauth)\n\u0026nbsp; \u0026nbsp;[![Go Report Card](https://goreportcard.com/badge/a4.io/go/indieauth)](https://goreportcard.com/report/a4.io/go/indieauth)\n\u0026nbsp; \u0026nbsp;[![License](http://img.shields.io/badge/license-MIT-red.svg?style=flat)](https://raw.githubusercontent.com/tsileo/indieauth/master/LICENSE)\n\nThis package implements an [IndieAuth (an identity layer on top of OAuth 2.0)](https://www.w3.org/TR/indieauth/) client/authentication middleware.\n\nIt implements an **IndieAuth Client** and will use your own external Authorization Endpoint.\n\nIt was designed to replace basic authentication when restricting access to private projects, it does not support multiple users.\n\nRelies on the [sessions package from the Gorilla web toolkit](http://www.gorillatoolkit.org/pkg/sessions).\n\n## QuickStart\n\n```bash\n$ get get a4.io/go/indieauth\n```\n\n**Note:** If you are not using gorilla/mux, you need to wrap your handlers with [`context.ClearHandler`](http://www.gorillatoolkit.org/pkg/context#ClearHandler) to prevent leaking memory.\n\n```go\npackage main\n\nimport (\n        \"log\"\n        \"net/http\"\n\n        \"a4.io/go/indieauth\"\n\n        \"github.com/gorilla/context\"\n        \"github.com/gorilla/sessions\"\n)\n\nvar cookieStore = sessions.NewCookieStore([]byte(\"my-secret\"))\n\nfunc main() {\n        ia, err:= indieauth.New(cookieStore, \"https://my.indie.auth.domain\")\n        if err != nil {\n                panic(err)\n        }\n\tiaMiddleware = ia.Middleware()\n        http.HandleFunc(indieauth.DefaultRedirectPath, ia.RedirectHandler)\n        http.HandleFunc(\"/logout\", func(w http.ResponseWriter, r *http.Request) {\n                indie.Logout(w, r)\n        })\n        http.Handle(\"/\", iaMiddleware(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n                w.Write([]byte(\"YAY!\"))\n        })))\n        log.Fatal(http.ListenAndServe(\":8011\", context.ClearHandler(http.DefaultServeMux)))\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsileo%2Findieauth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftsileo%2Findieauth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsileo%2Findieauth/lists"}