{"id":29492649,"url":"https://github.com/mrrajputh/springboot-jwt-auth","last_synced_at":"2026-05-16T17:07:24.419Z","repository":{"id":303763011,"uuid":"1016557387","full_name":"mrRajputh/springboot-jwt-auth","owner":"mrRajputh","description":"Spring Boot 3 JWT Authentication System","archived":false,"fork":false,"pushed_at":"2025-07-09T08:22:08.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-09T09:54:40.635Z","etag":null,"topics":["jwt-authentication","jwt-authorization","jwt-token","postgresql-database","spring-boot","spring-security"],"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/mrRajputh.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":"2025-07-09T07:29:28.000Z","updated_at":"2025-07-09T08:38:15.000Z","dependencies_parsed_at":"2025-07-09T09:54:43.151Z","dependency_job_id":"ba21c8fb-1ffb-4087-bd58-2c2a43b721c4","html_url":"https://github.com/mrRajputh/springboot-jwt-auth","commit_stats":null,"previous_names":["mrrajputh/springboot-jwt-auth"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mrRajputh/springboot-jwt-auth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrRajputh%2Fspringboot-jwt-auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrRajputh%2Fspringboot-jwt-auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrRajputh%2Fspringboot-jwt-auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrRajputh%2Fspringboot-jwt-auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrRajputh","download_url":"https://codeload.github.com/mrRajputh/springboot-jwt-auth/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrRajputh%2Fspringboot-jwt-auth/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265443237,"owners_count":23766370,"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":["jwt-authentication","jwt-authorization","jwt-token","postgresql-database","spring-boot","spring-security"],"created_at":"2025-07-15T15:28:05.782Z","updated_at":"2025-10-29T15:34:17.685Z","avatar_url":"https://github.com/mrRajputh.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🔐 Spring Boot JWT Authentication System\n\nThis project is a **secure, production-ready JWT Authentication and Authorization system** built using **Spring Boot 3.0**, **Spring Security 6.0**, and **Java 17**. It demonstrates how to implement user registration, login, and role-based access to protected endpoints using JWT tokens.\n\n---\n\n## 🚀 Features\n\n- ✅ User Registration \u0026 Authentication\n- 🔐 Stateless Security with JWT Tokens\n- 🔁 Secure Token Generation (256-bit key)\n- 🧑‍💻 Role-Based Access Control (RBAC)\n- 🔐 Password Encryption using BCrypt\n- 🧱 Modular Architecture: Controller, Service, Repository\n- ⚙️ Configurable `application.yml`\n- 🧪 API Testing via Postman or Swagger UI\n\n---\n\n## 🧰 Tech Stack\n\n| Layer        | Technology                         |\n|--------------|-------------------------------------|\n| Language     | Java 17                             |\n| Framework    | Spring Boot 3, Spring Security 6    |\n| Build Tool   | Maven                               |\n| ORM          | JPA, Hibernate                      |\n| DB           | PostgreSQL / H2 (for testing)       |\n| Auth Method  | JWT (JJWT Library)                  |\n\n---\n\n## 📁 Project Structure\n\nsrc/\n\n└── main/\n\n└── java/\n\n└── com/arjun/sec/\n\n├── auth/ # DTOs \u0026 AuthService\n\n├── config/ # JWT \u0026 Security Config\n\n├── controller/ # REST endpoints\n\n├── entity/ # User entity \u0026 roles\n\n├── repository/ # Data access layer\n\n└── SecApplication.java\n\n\n---\n\n## 📦 Getting Started\n\n### 1️⃣ Clone the Repo\n\nbash: \ngit clone  https://github.com/mrRajputh/springboot-jwt-auth.git\n\n2️⃣ Configure Your DB (PostgreSQL / H2)\n\nOpen src/main/resources/application.yml and set your DB config:\n\nspring:\n\n  datasource:\n  \n    url: jdbc:postgresql://localhost:5432/jwt_security\n    \n    username: write here your username\n    \n    password: write here your password\n    \n    driver-class-name: org.postgresql.Driver\n    \n  jpa:\n  \n    hibernate:\n    \n      ddl-auto: create-drop\n      \n    show-sql: true\n    \n    properties:\n\n      hibernate:\n      \n        format_sql: true\n        \n    database: postgresql\n    \n    database-platform: org.hibernate.dialect.PostgreSQLDialect\n    \n\n\n🔐 JWT 256-bit Secret Key Setup\n\nTo securely generate and sign JWT tokens, this project uses a 256-bit secret key.\n\n✅ Generate a 256-bit Key\nYou can generate a 256-bit key using any of the following methods:\n\nYou can use any online 256-bit key generator web site from google\n\nExample:\n\nVisit: https://www.allkeysgenerator.com\n\nSelect:\n\nKey size: 256-bit\n\nOutput format: Base64\n\n\n🔐Add the Key to JwtService.java\n\nprivate static final String SECRET_KEY = \"your-256-bit-base64-key-goes-here\";\n    \n\n\n3️⃣ Run the Application\nbash:\n\n./mvnw spring-boot:run\n\nOr run directly from your IDE (IntelliJ, Eclipse, etc.)\n\n🔐 API Endpoints (you can use postman to test api Endpoints )\n\n| Endpoint                    | Method | Description                 |\n| --------------------------- | ------ | --------------------------- |\n| `/api/v1/auth/register`     | POST   | Register a new user         |\n| `/api/v1/auth/authenticate` | POST   | Login and receive JWT token |\n| `/api/v1/demo-controller`   | GET    | Access protected endpoint   |\n\n\n\n📊 Future Improvements:\n\n🔁 Add Refresh Token functionality\n\n🧪 Unit \u0026 Integration Tests\n\n🧰 Dockerfile \u0026 docker-compose setup\n\n📜 Swagger API Docs\n\n📡 Monitoring (Prometheus/Grafana)\n\n🔐 MFA or OAuth2 integration\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrrajputh%2Fspringboot-jwt-auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrrajputh%2Fspringboot-jwt-auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrrajputh%2Fspringboot-jwt-auth/lists"}