{"id":18701100,"url":"https://github.com/toquery/clever-framework-oauth","last_synced_at":"2025-07-26T10:11:54.691Z","repository":{"id":97927273,"uuid":"479783580","full_name":"ToQuery/clever-framework-oauth","owner":"ToQuery","description":"clever-framework 的 Oauth认证系统","archived":false,"fork":false,"pushed_at":"2024-03-20T17:09:34.000Z","size":20,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-28T05:25:53.756Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/ToQuery.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-04-09T16:33:42.000Z","updated_at":"2022-04-19T13:45:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"856e1a87-0347-4a96-bda1-b9d381e23ebf","html_url":"https://github.com/ToQuery/clever-framework-oauth","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/ToQuery%2Fclever-framework-oauth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ToQuery%2Fclever-framework-oauth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ToQuery%2Fclever-framework-oauth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ToQuery%2Fclever-framework-oauth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ToQuery","download_url":"https://codeload.github.com/ToQuery/clever-framework-oauth/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239565651,"owners_count":19660154,"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-11-07T11:40:37.647Z","updated_at":"2025-02-18T22:45:21.144Z","avatar_url":"https://github.com/ToQuery.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# clever-framework-oauth2\nclever-framework 的 Oauth认证系统\n\n- [OAuth2](https://oauth.net/2/)\n\n## 使用方法\n\n## 数据库表\n\n\n\n- 客户端配置信息注册 （oauth2_registered_client）\n\n授权服务器要求客户端必须是已经注册的，避免非法的客户端发起授权申请。就像你平常去一些开放平台申请一个`ClientID`和`Secret`。下面是定义脚本（oauth2-registered-client-schema.sql）:\n\n```sql\nCREATE TABLE oauth2_registered_client\n(\n    id                            varchar(100)                        NOT NULL,\n    client_id                     varchar(100)                        NOT NULL,\n    client_id_issued_at           timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL,\n    client_secret                 varchar(200)                        NULL,\n    client_secret_expires_at      timestamp                           NULL,\n    client_name                   varchar(200)                        NOT NULL,\n    client_authentication_methods varchar(1000)                       NOT NULL,\n    authorization_grant_types     varchar(1000)                       NOT NULL,\n    redirect_uris                 varchar(1000)                       NULL,\n    scopes                        varchar(1000)                       NOT NULL,\n    client_settings               varchar(2000)                       NOT NULL,\n    token_settings                varchar(2000)                       NOT NULL,\n    PRIMARY KEY (id)\n);\n```\n\n\n\n- OAuth2授权信息持久化（oauth2_authorization）（）\n\n记录授权的资源拥有者（Resource Owner）对某个客户端的某次授权记录。对应的Java类为`OAuth2Authorization`。下面是定义脚本（oauth2-authorization-schema.sql）:\n\n```sql\n\nCREATE TABLE oauth2_authorization\n(\n    id                            varchar(100)  NOT NULL,\n    registered_client_id          varchar(100)  NOT NULL,\n    principal_name                varchar(200)  NOT NULL,\n    authorization_grant_type      varchar(100)  NOT NULL,\n    attributes                    varchar(4000) NULL,\n    state                         varchar(500)  NULL,\n    authorization_code_value      blob          NULL,\n    `authorization_code_issued_at`  timestamp     NULL,\n    authorization_code_expires_at timestamp     NULL,\n    authorization_code_metadata   varchar(2000) NULL,\n    access_token_value            blob          NULL,\n    access_token_issued_at        timestamp     NULL,\n    access_token_expires_at       timestamp     NULL,\n    access_token_metadata         varchar(2000) NULL,\n    access_token_type             varchar(100)  NULL,\n    access_token_scopes           varchar(1000) NULL,\n    oidc_id_token_value           blob          NULL,\n    oidc_id_token_issued_at       timestamp     NULL,\n    oidc_id_token_expires_at      timestamp     NULL,\n    oidc_id_token_metadata        varchar(2000) NULL,\n    refresh_token_value           blob          NULL,\n    refresh_token_issued_at       timestamp     NULL,\n    refresh_token_expires_at      timestamp     NULL,\n    refresh_token_metadata        varchar(2000) NULL,\n    PRIMARY KEY (id)\n);\n```\n\n\n\n- 确认授权持久化（oauth2_authorization_consent）\n\n资源拥有者（Resource Owner）对授权的确认信息`OAuth2AuthorizationConsent`的持久化，这个比较简单。下面是定义脚本（oauth2-authorization-consent-schema.sql）:\n\n```sql\n\nCREATE TABLE oauth2_authorization_consent\n(\n    registered_client_id varchar(100)  NOT NULL,\n    principal_name       varchar(200)  NOT NULL,\n    authorities          varchar(1000) NOT NULL,\n    PRIMARY KEY (registered_client_id, principal_name)\n);\n```\n\n\n\n## 文章连接\n\n\n\n- https://blog.csdn.net/j3T9Z7H/article/details/121413063\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoquery%2Fclever-framework-oauth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftoquery%2Fclever-framework-oauth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoquery%2Fclever-framework-oauth/lists"}