{"id":28497214,"url":"https://github.com/maxi-schaefer/spring-authentication","last_synced_at":"2025-10-06T14:34:21.899Z","repository":{"id":295697483,"uuid":"867159005","full_name":"maxi-schaefer/spring-authentication","owner":"maxi-schaefer","description":"Simple Spring authentication Project with JWT and MySQL for learning purpose","archived":false,"fork":false,"pushed_at":"2025-05-26T22:38:48.000Z","size":661,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-08T13:05:27.308Z","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/maxi-schaefer.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,"zenodo":null}},"created_at":"2024-10-03T14:52:50.000Z","updated_at":"2025-05-26T22:38:53.000Z","dependencies_parsed_at":"2025-05-29T15:16:35.573Z","dependency_job_id":null,"html_url":"https://github.com/maxi-schaefer/spring-authentication","commit_stats":null,"previous_names":["maxi-schaefer/spring-authentication"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/maxi-schaefer/spring-authentication","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxi-schaefer%2Fspring-authentication","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxi-schaefer%2Fspring-authentication/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxi-schaefer%2Fspring-authentication/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxi-schaefer%2Fspring-authentication/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maxi-schaefer","download_url":"https://codeload.github.com/maxi-schaefer/spring-authentication/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxi-schaefer%2Fspring-authentication/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278625128,"owners_count":26017885,"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","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"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":[],"created_at":"2025-06-08T13:05:28.621Z","updated_at":"2025-10-06T14:34:21.894Z","avatar_url":"https://github.com/maxi-schaefer.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"![](./banner.png)\n# Spring Authentication with JWT and MySQL\nSimple Spring authentication Project with JWT and MySQL for learning purpose\n\n## How to setup\nCreate a mysql database for example with [Docker](https://docker.com):\n```bash\ndocker run -d -e MYSQL_ROOT_PASSWORD=secret -e MYSQL_DATABASE=taskdb --name mysqldb -p 3307:3306 mysql:8.0\n```\nThis command generates a mysql container with the root password `secret`\n\n## How to start\nOpen the project directory and run following command:\n```bash\nmvn spring-boot:run\n```\nThis will start the Spring Application\n\n## Enpoints overview:\n### POST /auth/register\nRequest:\n```json\n{\n    \"fullName\": \"John Doe\",\n    \"email\": \"johndoe@mail.com\",\n    \"password\": \"password\"\n}\n```\nResponse:\n```json\n{\n  \"user\": {\n    \"id\": \"fda77ad1-4575-40c1-9ff4-be9f3a01da8e\",\n    \"fullName\": \"John Doe\",\n    \"email\": \"johndoe@mail.com\",\n    \"createdAt\": \"2025-05-26T22:35:02.652+00:00\",\n    \"updatedAt\": \"2025-05-26T22:35:02.652+00:00\",\n    \"enabled\": true,\n    \"authorities\": [],\n    \"username\": \"johndoe@mail.com\",\n    \"credentialsNonExpired\": true,\n    \"accountNonExpired\": true,\n    \"accountNonLocked\": true\n  },\n  \"token\": \"TOKEN\",\n  \"expiresIn\": 3600000\n}\n```\n\n### POST /auth/login\nRequest:\n```json\n{\n    \"email\": \"johndoe@mail.com\",\n    \"password\": \"password\"\n}\n```\nResponse:\n```json\n{\n  \"user\": {\n    \"id\": \"fda77ad1-4575-40c1-9ff4-be9f3a01da8e\",\n    \"fullName\": \"John Doe\",\n    \"email\": \"johndoe@mail.com\",\n    \"createdAt\": \"2025-05-26T22:35:02.652+00:00\",\n    \"updatedAt\": \"2025-05-26T22:35:02.652+00:00\",\n    \"enabled\": true,\n    \"authorities\": [],\n    \"username\": \"johndoe@mail.com\",\n    \"credentialsNonExpired\": true,\n    \"accountNonExpired\": true,\n    \"accountNonLocked\": true\n  },\n  \"token\": \"TOKEN\",\n  \"expiresIn\": 3600000\n}\n```\n\n### GET /users\nRequest: Header with Bearer Authorization\nResponse:\n```json\n[\n  {\n    \"id\": \"fda77ad1-4575-40c1-9ff4-be9f3a01da8e\",\n    \"fullName\": \"John Doe\",\n    \"email\": \"johndoe@mail.com\",\n    \"createdAt\": \"2025-05-26T22:35:02.652+00:00\",\n    \"updatedAt\": \"2025-05-26T22:35:02.652+00:00\",\n    \"enabled\": true,\n    \"authorities\": [],\n    \"username\": \"johndoe@mail.com\",\n    \"credentialsNonExpired\": true,\n    \"accountNonExpired\": true,\n    \"accountNonLocked\": true\n  }\n]\n```\n\n### GET /users/me\nRequest: Header with Bearer Authorization\nResponse:\n```json\n{\n  \"id\": \"fda77ad1-4575-40c1-9ff4-be9f3a01da8e\",\n  \"fullName\": \"John Doe\",\n  \"email\": \"johndoe@mail.com\",\n  \"createdAt\": \"2025-05-26T22:35:02.652+00:00\",\n  \"updatedAt\": \"2025-05-26T22:35:02.652+00:00\",\n  \"enabled\": true,\n  \"authorities\": [],\n  \"username\": \"johndoe@mail.com\",\n  \"credentialsNonExpired\": true,\n  \"accountNonExpired\": true,\n  \"accountNonLocked\": true\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxi-schaefer%2Fspring-authentication","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxi-schaefer%2Fspring-authentication","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxi-schaefer%2Fspring-authentication/lists"}