{"id":17679304,"url":"https://github.com/bbkane/learnoauth","last_synced_at":"2025-03-30T18:28:05.119Z","repository":{"id":87170797,"uuid":"454997747","full_name":"bbkane/learnoauth","owner":"bbkane","description":null,"archived":false,"fork":false,"pushed_at":"2022-02-03T01:50:37.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T19:49:30.265Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bbkane.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2022-02-03T01:50:22.000Z","updated_at":"2022-02-03T01:50:40.000Z","dependencies_parsed_at":"2023-03-10T10:16:04.965Z","dependency_job_id":null,"html_url":"https://github.com/bbkane/learnoauth","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbkane%2Flearnoauth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbkane%2Flearnoauth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbkane%2Flearnoauth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbkane%2Flearnoauth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bbkane","download_url":"https://codeload.github.com/bbkane/learnoauth/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246361240,"owners_count":20764894,"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":[],"created_at":"2024-10-24T08:22:01.565Z","updated_at":"2025-03-30T18:28:05.091Z","avatar_url":"https://github.com/bbkane.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# a01-blog\n\nhttps://sharmarajdaksh.github.io/blog/github-oauth-with-go\n\nhttps://www.sohamkamani.com/golang/oauth/\n\n# a02-wtf\n\nhttps://github.com/settings/applications/1818912\n\nThe goal here is to get auth1 functionality with mux and google oauth2, similar to warg.\n\nThen I can add the session stuff as well as state param\n\n# a03-securecookie\n\nhttps://developpaper.com/go-one-library-per-day-gorilla-securecookie/\n\nLet's just copy this :)\n\n```\n$ curl -i http://localhost:8080/set\nHTTP/1.1 200 OK\nSet-Cookie: user=MTY0Mzg0MTU3OHx6d3V4anI1QU9vdXlUQTBPVWhEd2U3VUw0RGZsWmlkNG9QaEM5LWEtWEVoa0NzYWJ5c0o4ZFhHVklvMUFGNXVqQkdQV0IyQlhHV05DT0xaY2dpZz18PI_0-opCO2ynG5JNeG-2qa38cLwJTkByv1EC5lSROdE=; Path=/; HttpOnly; Secure\nDate: Wed, 02 Feb 2022 22:39:38 GMT\nContent-Length: 12\nContent-Type: text/plain; charset=utf-8\n\nHello World\n14:39:38.131 PST mac02:~\n$ curl -i http://localhost:8080/get --cookie 'user=MTY0Mzg0MTU3OHx6d3V4anI1QU9vdXlUQTBPVWhEd2U3VUw0RGZsWmlkNG9QaEM5LWEtWEVoa0NzYWJ5c0o4ZFhHVklvMUFGNXVqQkdQV0IyQlhHV05DT0xaY2dpZz18PI_0-opCO2ynG5JNeG-2qa38cLwJTkByv1EC5lSROdE=; Path=/; HttpOnly; Secure'\nHTTP/1.1 200 OK\nDate: Wed, 02 Feb 2022 22:40:04 GMT\nContent-Length: 14\nContent-Type: text/plain; charset=utf-8\n\nname:dj age:18%\n```\n\n# a04-cookie\n\n- set cookie on login\n- save the following into a data structure\n  - user auth information from /login/github/callback (token)\n  - username\n  - cookie\n- redirect the user a page showing GitHub info if they're logged in\n\nhttps://pkg.go.dev/github.com/benbjohnson/wtf#Auth\n\nOk, it looks like I'm setting the cookie in the response, but the browser isn't sending the cookie back. This leads to an Oauth state mismatch\n\nLet's make a \"set and read cookie\" folder until I can get back to this...\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbkane%2Flearnoauth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbbkane%2Flearnoauth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbkane%2Flearnoauth/lists"}