{"id":18806593,"url":"https://github.com/imdadmi/jwt-authentication-spring-security","last_synced_at":"2026-04-27T18:02:52.283Z","repository":{"id":181908536,"uuid":"667103054","full_name":"IMDADMI/Jwt-Authentication-Spring-Security","owner":"IMDADMI","description":"Sample JAVA project on how to implement JWT security based using Spring boot 3 and Spring security 6","archived":false,"fork":false,"pushed_at":"2023-07-24T15:43:07.000Z","size":118,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-01T23:04:56.935Z","etag":null,"topics":["authentication","authorization","intelij","jwt","jwt-authentication","spring-boot","spring-security","spring-security-jwt"],"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/IMDADMI.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":"2023-07-16T16:42:16.000Z","updated_at":"2023-07-24T15:44:30.000Z","dependencies_parsed_at":"2024-11-07T22:49:13.437Z","dependency_job_id":"eb95c50f-bdfb-4403-839e-3f4a37ea9fa8","html_url":"https://github.com/IMDADMI/Jwt-Authentication-Spring-Security","commit_stats":null,"previous_names":["imdadmi/jwt-authentication-spring-security"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/IMDADMI/Jwt-Authentication-Spring-Security","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IMDADMI%2FJwt-Authentication-Spring-Security","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IMDADMI%2FJwt-Authentication-Spring-Security/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IMDADMI%2FJwt-Authentication-Spring-Security/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IMDADMI%2FJwt-Authentication-Spring-Security/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IMDADMI","download_url":"https://codeload.github.com/IMDADMI/Jwt-Authentication-Spring-Security/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IMDADMI%2FJwt-Authentication-Spring-Security/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32348058,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T17:12:42.749Z","status":"ssl_error","status_checked_at":"2026-04-27T17:12:41.658Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["authentication","authorization","intelij","jwt","jwt-authentication","spring-boot","spring-security","spring-security-jwt"],"created_at":"2024-11-07T22:49:00.950Z","updated_at":"2026-04-27T18:02:52.243Z","avatar_url":"https://github.com/IMDADMI.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Stateless authentication system using JWT and spring security\n\nThis is the backend part of the jwt security method you can view the front part in the Jwt-Authentication repository in admi branch\n### You can view the backend part in the repository **Jwt-Authentication-Spring-Security** \n## TIPS\n**_please make sure to add the roles (USER,ADMIN) and the admin user manually using the api_**\n#\n**_please make sure to add your database configuration in the Application.properties file_**\n#\n\n## Demo\nthis app is bootstrapped by https://start.spring.io/ \nTo start the application go to the app root and run \n```bash\n  ./mvnw install\n```  \nthen run the api using you favorit ide\n\n\n# Documentation\n\n## JWT Introduction\nJSON Web Tokens (JWT) are a compact and self-contained way to represent information between two parties. In our case, JWTs will be used to securely transmit authentication details between the client and the server. The token contains claims (data) that are digitally signed, ensuring their authenticity and integrity.\n## how the authentication flow works in this system\n### User Authentication:\nWhen a user attempts to log in with their username and password, Spring Security's authentication process comes into play. The user's credentials are verified against the stored credentials (e.g., in a database) to ensure they are valid.\n### JWT Generation and Sending:\nUpon successful authentication, the server generates a JWT containing relevant user information (e.g., username, roles), signs it with **HMAC 256**, and sends it back to the client in the response headers or as part of the response body.\n\n### Subsequent Requests\nFor subsequent requests to secured API endpoints, the client must include the JWT in the request headers. The server verifies the token's signature and extracts the user information from the token's claims. If the token is valid and not expired, the user is considered authenticated, and the request proceeds\n### Securing Controller Methods:\nTo secure specific API endpoints, i use the @Secure annotation provided by Spring Security. This annotation ensures that only authenticated users with the necessary roles (specified in the annotation) can access the protected resources.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimdadmi%2Fjwt-authentication-spring-security","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimdadmi%2Fjwt-authentication-spring-security","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimdadmi%2Fjwt-authentication-spring-security/lists"}