{"id":15252247,"url":"https://github.com/willin/sso","last_synced_at":"2025-09-12T07:34:29.075Z","repository":{"id":207119976,"uuid":"718145807","full_name":"willin/sso","owner":"willin","description":"A simple sso provider using Cloudflare Pages, D1, KV, Hono and Svelte","archived":false,"fork":false,"pushed_at":"2024-03-05T06:57:28.000Z","size":2090,"stargazers_count":34,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-10T18:47:29.377Z","etag":null,"topics":["authing","hono","idaas","oauth","oidc","sso","svelte"],"latest_commit_sha":null,"homepage":"https://sso.willin.wang","language":"TypeScript","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/willin.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},"funding":{"github":"willin","custom":"https://afdian.net/@willin"}},"created_at":"2023-11-13T13:32:34.000Z","updated_at":"2025-03-23T18:44:23.000Z","dependencies_parsed_at":"2024-04-17T02:36:38.320Z","dependency_job_id":"60293509-fc3a-44b8-a3c3-8ad60f12625e","html_url":"https://github.com/willin/sso","commit_stats":{"total_commits":56,"total_committers":2,"mean_commits":28.0,"dds":"0.017857142857142905","last_synced_commit":"9a778a189e2b35f336dcc7fb43d768e9de5661c8"},"previous_names":["willin/sso"],"tags_count":4,"template":false,"template_full_name":"willin/remix-cloudflare-pages-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willin%2Fsso","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willin%2Fsso/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willin%2Fsso/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willin%2Fsso/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/willin","download_url":"https://codeload.github.com/willin/sso/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248317707,"owners_count":21083528,"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":["authing","hono","idaas","oauth","oidc","sso","svelte"],"created_at":"2024-09-29T19:05:26.821Z","updated_at":"2025-04-10T23:50:48.134Z","avatar_url":"https://github.com/willin.png","language":"TypeScript","readme":"# An Open-Source SSO System\n\nbuilt with Hono.js \u0026 SvelteKit\n\n## 开源免费的 IDaaS （SSO 单点登录）服务\n\nFree IDaas And Single Sign-On Service\n\n[![GitHub Repo stars](https://img.shields.io/github/stars/willin/sso?style=social)](https://github.com/willin/sso) [![Fork](https://img.shields.io/github/contributors/willin/sso)](https://github.com/willin/sso/fork)\n\n[中文网站](https://sso.willin.wang) | [English Website](https://sso.willin.wang/en)\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n\n- [An Open-Source SSO System](#an-open-source-sso-system)\n  - [开源免费的 IDaaS （SSO 单点登录）服务](#开源免费的-idaas-sso-单点登录服务)\n  - [相关文档 Documentation](#相关文档-documentation)\n  - [端点 Endpoints](#端点-endpoints)\n  - [开源包 Packages](#开源包-packages)\n    - [Packages](#packages)\n  - [开发/部署 Development \\\u0026 Deployment](#开发部署-development--deployment)\n    - [部署](#部署)\n    - [本地开发](#本地开发)\n    - [Deployment](#deployment)\n    - [Local Development](#local-development)\n  - [赞助 Sponsor](#赞助-sponsor)\n  - [许可证 License](#许可证-license)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n## 相关文档 Documentation\n\n- 设计文档 Design (In Chinese)： \u003chttps://blog.csdn.net/jslygwx/article/details/133765190\u003e\n- 开发文档 Dev Guides: TBD\n- 部署文档 Deployment Guides: TBD\n\n## 端点 Endpoints\n\n- `/auth/authorize` GET\n- `/auth/token` POST\n- `/auth/userinfo` GET\n- `/auth/revoke` POST\n- `/$lang/login` (以下需要登录 below need login)\n- `/$lang/dashboard`\n- `/api/apps` GET/POST\n- `/api/apps/:id` GET/PUT\n- `/api/apps/:id/secret` POST/DELETE\n- `/api/users` GET\n- `/api/users/:id` GET/PUT/POST\n- `/api/users/:id/forbidden` PUT/POST\n- `/api/users/:id/:provider` DELETE\n\n## 开源包 Packages\n\n### Packages\n\n| Package                                             | Meta                                                                                                                                                                                                                                                                                                                                                                                                                             | Changelog                                           |\n| --------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- |\n| [@hono-dev/auth-github](packages/hono-auth-github/) | [![npm](https://img.shields.io/npm/v/@hono-dev/auth-github?style=flat-square\u0026logo=npm)](https://npmjs.org/package/@hono-dev/auth-github) [![npm](https://img.shields.io/npm/dm/@hono-dev/auth-github?style=flat-square\u0026label=down)](https://npmjs.org/package/@hono-dev/auth-github) [![npm](https://img.shields.io/npm/dt/@hono-dev/auth-github?style=flat-square\u0026label=down)](https://npmjs.org/package/@hono-dev/auth-github) | [Changelog](packages/hono-auth-github/CHANGELOG.md) |\n| [@hono-dev/auth-alipay](packages/hono-auth-alipay/) | [![npm](https://img.shields.io/npm/v/@hono-dev/auth-alipay?style=flat-square\u0026logo=npm)](https://npmjs.org/package/@hono-dev/auth-alipay) [![npm](https://img.shields.io/npm/dm/@hono-dev/auth-alipay?style=flat-square\u0026label=down)](https://npmjs.org/package/@hono-dev/auth-alipay) [![npm](https://img.shields.io/npm/dt/@hono-dev/auth-alipay?style=flat-square\u0026label=down)](https://npmjs.org/package/@hono-dev/auth-alipay) | [Changelog](packages/hono-auth-alipay/CHANGELOG.md) |\n| [@hono-dev/auth-afdian](packages/hono-auth-afdian/) | [![npm](https://img.shields.io/npm/v/@hono-dev/auth-afdian?style=flat-square\u0026logo=npm)](https://npmjs.org/package/@hono-dev/auth-afdian) [![npm](https://img.shields.io/npm/dm/@hono-dev/auth-afdian?style=flat-square\u0026label=down)](https://npmjs.org/package/@hono-dev/auth-afdian) [![npm](https://img.shields.io/npm/dt/@hono-dev/auth-afdian?style=flat-square\u0026label=down)](https://npmjs.org/package/@hono-dev/auth-afdian) | [Changelog](packages/hono-auth-afdian/CHANGELOG.md) |\n| [@hono-dev/powered-by](packages/hono-powered-by/)   | [![npm](https://img.shields.io/npm/v/@hono-dev/powered-by?style=flat-square\u0026logo=npm)](https://npmjs.org/package/@hono-dev/powered-by) [![npm](https://img.shields.io/npm/dm/@hono-dev/powered-by?style=flat-square\u0026label=down)](https://npmjs.org/package/@hono-dev/powered-by) [![npm](https://img.shields.io/npm/dt/@hono-dev/powered-by?style=flat-square\u0026label=down)](https://npmjs.org/package/@hono-dev/powered-by)       | [Changelog](packages/hono-powered-by/CHANGELOG.md)  |\n\n## 开发/部署 Development \u0026 Deployment\n\n### 部署\n\n\u003e [!IMPORTANT]\n\u003e 如果需要定制化的开发，比如删除/新增登录方式，则需要具备专业的开发知识，或者联系我进行付费定制。\n\n1. 需要有 Cloudflare 账号、可配置域名和 Github 账号三项前置准备\n2. 在 Cloudflare 中创建好 D1 数据库和 KV 缓存桶。\n   - 创建 [KV 存储桶](https://dash.cloudflare.com/?to=/:account/workers/kv/namespaces)\n   - 创建 [D1 数据库](https://dash.cloudflare.com/?to=/:account/workers/d1)\n   - 创建 [API Token](https://dash.cloudflare.com/profile/api-tokens)\n3. Fork 本项目，在 Settings 中做后续环境变量配置\n4. 设置环境变量，参考 `本地开发`。注意：\n   - 创建 [Github OAuth 应用](https://github.com/settings/developers)\n   - 创建 [支付宝基础应用](https://open.alipay.com/develop/manage)\n   - 爱发电应用需要私信 [@afdian](https://afdian.net/a/afdian)\n   - 如果使用 Github 的 Secrets，则不能用 `GITHUB_` 前缀，所以我改成了 `GH_` 前缀，但代码中没有更改，只在 Workflow 中映射\n   - 注意：只有 Github 可以不填 CALLBACK_URL（其他登录方式均需要指定域名回调）\n\n### 本地开发\n\n1. 配置开发环境，推荐使用 `bun` 进行开发\n2. 创建 `apps/website/.dev.vars` 将 `AFDIAN_CLIENT_ID`、`AFDIAN_CLIENT_SECRET` 等环境变量进行配置。\n3. 安装依赖 `bun install \u0026\u0026 bun run build`\n\n```bash\nAFDIAN_CLIENT_ID=\nAFDIAN_CLIENT_SECRET=\nAFDIAN_CALLBACK_URL=\nGITHUB_ID=\nGITHUB_SECRET=\nGITHUB__CALLBACK_URL=optional\nALIPAY_APP_ID=\nALIPAY_CALLBACK_URL=\nALIPAY_PRIVATE_KEY=\nSESSION_KEY=optional\nSESSION_SECRET=\n```\n\n4. 在 `apps/website`目录下初始化数据库： `npx wrangler d1 migrations apply sso --local`\n5. 启动 `bun run build \u0026\u0026 bun run dev`\n6. 手动修改 `apps/website/.wrangler/state/v3/d1/miniflare-D1DatabaseObject` 下的数据库，通过 SQLite 软件，将你的第一个用户类型 `type` 改为 `admin`\n\n### Deployment\n\n\u003e [!IMPORTANT]\n\u003e If you need customized development, such as deleting/adding login methods, you need to have professional development knowledge, or contact me for paid customization.\n\n1. You need to have a Cloudflare account, a configurable domain, and a Github account as prerequisites.\n2. Create a D1 database and KV bucket in Cloudflare.\n   - Create [KV bucket](https://dash.cloudflare.com/?to=/:account/workers/kv/namespaces)\n   - Create [D1 database](https://dash.cloudflare.com/?to=/:account/workers/d1)\n   - Create [API Token](https://dash.cloudflare.com/profile/api-tokens)\n3. Fork this project and do subsequent environment variable configuration in Settings.\n4. Set environment variables, refer to `Local Development`. Note:\n   - Create [Github OAuth App](https://github.com/settings/developers)\n   - Create [Alipay Basic App](https://open.alipay.com/develop/manage)\n   - For Afdian application, you need to send a private message to [@afdian](https://afdian.net/a/afdian)\n   - If you use Github's Secrets, you can't use the `GITHUB_` prefix, so I changed it to the `GH_` prefix, but the code has not been changed, only mapped in the Workflow\n   - Note: Only Github can leave CALLBACK_URL blank (other login methods need to specify the domain callback)\n\n### Local Development\n\n1. Configure the development environment, it is recommended to use `bun` for development.\n2. Create `apps/website/.dev.vars` and configure environment variables such as `AFDIAN_CLIENT_ID`, `AFDIAN_CLIENT_SECRET`.\n3. Install dependencies `bun install \u0026\u0026 bun bun build`\n\n```bash\nAFDIAN_CLIENT_ID=\nAFDIAN_CLIENT_SECRET=\nAFDIAN_CALLBACK_URL=\nGITHUB_ID=\nGITHUB_SECRET=\nGITHUB__CALLBACK_URL=optional\nALIPAY_APP_ID=\nALIPAY_CALLBACK_URL=\nALIPAY_PRIVATE_KEY=\nSESSION_KEY=optional\nSESSION_SECRET=\n```\n\n4. Cd to `apps/website` and init database with: `npx wrangler d1 migrations apply sso --local`\n5. Start with `bun run build \u0026\u0026 bun run dev`\n6. Manually modify the database under `apps/website/.wrangler/state/v3/d1/miniflare-D1DatabaseObject` using SQLite software, change your first user type `type` to `admin`\n\n## 赞助 Sponsor\n\n维护者 Owner： [Willin Wang](https://willin.wang)\n\n如果您对本项目感兴趣，可以通过以下方式支持我：\n\n- 关注我的 Github 账号：[@willin](https://github.com/willin) [![github](https://img.shields.io/github/followers/willin.svg?style=social\u0026label=Followers)](https://github.com/willin)\n- 参与 [爱发电](https://afdian.net/@willin) 计划\n- 支付宝或微信[扫码打赏](https://user-images.githubusercontent.com/1890238/89126156-0f3eeb80-d516-11ea-9046-5a3a5d59b86b.png)\n\nDonation ways:\n\n- Github: \u003chttps://github.com/sponsors/willin\u003e\n- Paypal: \u003chttps://paypal.me/willinwang\u003e\n- Alipay or Wechat Pay: [QRCode](https://user-images.githubusercontent.com/1890238/89126156-0f3eeb80-d516-11ea-9046-5a3a5d59b86b.png)\n\n## 许可证 License\n\nApache-2.0\n","funding_links":["https://github.com/sponsors/willin","https://afdian.net/@willin","https://paypal.me/willinwang"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillin%2Fsso","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwillin%2Fsso","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillin%2Fsso/lists"}