{"id":15777328,"url":"https://github.com/v5tech/spring-boot-jwt-sample","last_synced_at":"2026-04-29T19:33:46.416Z","repository":{"id":149461784,"uuid":"135298612","full_name":"v5tech/spring-boot-jwt-sample","owner":"v5tech","description":"spring-boot-jwt-sample","archived":false,"fork":false,"pushed_at":"2018-05-30T02:19:48.000Z","size":189,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-15T20:48:34.899Z","etag":null,"topics":["jwt","jwt-auth","jwt-token","spring-boot"],"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/v5tech.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}},"created_at":"2018-05-29T13:16:41.000Z","updated_at":"2022-10-06T04:02:29.000Z","dependencies_parsed_at":"2023-04-19T03:16:50.662Z","dependency_job_id":null,"html_url":"https://github.com/v5tech/spring-boot-jwt-sample","commit_stats":null,"previous_names":["v5tech/spring-boot-jwt-sample"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/v5tech/spring-boot-jwt-sample","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/v5tech%2Fspring-boot-jwt-sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/v5tech%2Fspring-boot-jwt-sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/v5tech%2Fspring-boot-jwt-sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/v5tech%2Fspring-boot-jwt-sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/v5tech","download_url":"https://codeload.github.com/v5tech/spring-boot-jwt-sample/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/v5tech%2Fspring-boot-jwt-sample/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32441190,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T18:12:22.909Z","status":"ssl_error","status_checked_at":"2026-04-29T18:11:33.322Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["jwt","jwt-auth","jwt-token","spring-boot"],"created_at":"2024-10-04T18:00:24.779Z","updated_at":"2026-04-29T19:33:46.394Z","avatar_url":"https://github.com/v5tech.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# spring-boot-jwt-sample\n\nspring boot整合jwt完成接口授权认证\n\n1、注册用户(POST)\n\nhttp://localhost:8081/api/v1.0/register\n\n```json\n{\n  \"id\": 1,\n  \"userName\": \"admin\",\n  \"loginName\": \"admin\",\n  \"password\": \"admin\",\n  \"roles\": \"admin\",\n  \"email\": \"admin@ameizi.net\",\n  \"location\": \"xi'an\",\n  \"signature\": \"admin\",\n  \"createAt\": \"2018/5/30 10:06\",\n  \"updateAt\": \"2018/5/30 10:06\"\n}\n```\n\n![](Screenshots/2018-05-30_100745.png)\n\n\n2、获取token(POST)\n\nhttp://localhost:8081/api/v1.0/auth/token\n\n```json\n{\n  \"userName\": \"admin\",\n  \"loginName\": \"admin\",\n  \"password\": \"admin\"\n}\n```\n\n![](Screenshots/2018-05-30_100905.png)\n\n![](Screenshots/2018-05-30_100930.png)\n\n3、请求接口(GET)\n\nhttp://localhost:8081/api/v1.0/users/current\n\n在请求头中添加第二步操作生成的jwt token\n\n在`Header`中添加`Authorization`其值为上一步生成的`token`信息如：`Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsImp0aSI6IjEiLCJyb2xlcyI6InVzZXIiLCJhdWQiOiJ3ZWIiLCJpYXQiOjE1Mjc2NDYxNjUsImlzcyI6ImFkbWluIiwiZXhwIjoxNTI3NzMyNTY1fQ.5kglv2hGTfmJ9PW61BFiak09NFW2aHRckP3GUdpkPe8W3K7psc0QCVOp7CNbfIB1LEC-JixX1RQCA6ymWyupIw`\n\n![](Screenshots/2018-05-30_101041.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fv5tech%2Fspring-boot-jwt-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fv5tech%2Fspring-boot-jwt-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fv5tech%2Fspring-boot-jwt-sample/lists"}