{"id":18537878,"url":"https://github.com/netbuffer/oauth-protocol-demo","last_synced_at":"2026-04-06T08:01:33.283Z","repository":{"id":150942260,"uuid":"407783830","full_name":"netbuffer/oauth-protocol-demo","owner":"netbuffer","description":"oauth protocol test，oauth2 server/client endpoint，use sa-token，spring-boot","archived":false,"fork":false,"pushed_at":"2025-11-01T14:12:20.000Z","size":427,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-11-01T15:19:23.758Z","etag":null,"topics":["api","git","hosts","javaee","javaweb","jwt","maven","oauth","oauth2","permission","restful","sa-token","spring","spring-boot","springframework","tomcat"],"latest_commit_sha":null,"homepage":"","language":"Java","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/netbuffer.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":"2021-09-18T07:02:34.000Z","updated_at":"2025-11-01T14:12:23.000Z","dependencies_parsed_at":"2023-05-06T18:48:03.658Z","dependency_job_id":null,"html_url":"https://github.com/netbuffer/oauth-protocol-demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/netbuffer/oauth-protocol-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netbuffer%2Foauth-protocol-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netbuffer%2Foauth-protocol-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netbuffer%2Foauth-protocol-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netbuffer%2Foauth-protocol-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/netbuffer","download_url":"https://codeload.github.com/netbuffer/oauth-protocol-demo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netbuffer%2Foauth-protocol-demo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31464102,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T21:22:52.476Z","status":"online","status_checked_at":"2026-04-06T02:00:07.287Z","response_time":112,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["api","git","hosts","javaee","javaweb","jwt","maven","oauth","oauth2","permission","restful","sa-token","spring","spring-boot","springframework","tomcat"],"created_at":"2024-11-06T19:40:49.640Z","updated_at":"2026-04-06T08:01:33.264Z","avatar_url":"https://github.com/netbuffer.png","language":"Java","readme":"# oauth-protocol-demo\n![](https://img.shields.io/static/v1?label=jdk\u0026message=1.8\u0026color=blue)\n![](https://img.shields.io/static/v1?label=sppring-boot\u0026message=2.7.18\u0026color=blue)\n![](https://img.shields.io/static/v1?label=sa-token\u0026message=1.44.0\u0026color=47BA86)\n\u003e 基于 [sa-token](https://sa-token.dev33.cn/) 实现oauth2协议\n\n* [sa-token-oauth2-server](https://sa-token.cc/doc.html#/oauth2/oauth2-server)\n* https://github.com/netbuffer/oauth-protocol-demo\n* https://gitee.com/netbuffer/oauth-protocol-demo\n\n### help\n1. 编辑`C:\\Windows\\System32\\drivers\\etc\\hosts`增加如下配置\n```\n127.0.0.1 oauth-server.com\n127.0.0.1 oauth-client.com\n```\n2. 访问 [/oauth2/authorize](http://oauth-server.com:19000/oauth2/authorize?response_type=code\u0026client_id=10001\u0026redirect_uri=https://sa-token.cc\u0026scope=userinfo) 进行登录授权  \n检测用户在oauth2 server上的登录状态，登录后，再进行oauth2授权流程\n\n![](help/oauth-server-login.png)\n![](help/oauth-server-auth.png)\n![](help/oauth-server-code.png)\n\n3. 访问 [/oauth2/token](http://oauth-server.com:19000/oauth2/token?grant_type=authorization_code\u0026client_id=10001\u0026client_secret=lzNjiJInCcWVSIQGHbX83uL5C7HSXaHX\u0026code={code}) 获取access_token等信息(替换掉其中的code授权码参数)\n![oauth-server-access-token.png](help/oauth-server-access-token.png)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetbuffer%2Foauth-protocol-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetbuffer%2Foauth-protocol-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetbuffer%2Foauth-protocol-demo/lists"}