{"id":28666424,"url":"https://github.com/anmol420/authenticationsystemapi","last_synced_at":"2026-05-03T17:32:49.395Z","repository":{"id":298490667,"uuid":"998346862","full_name":"anmol420/AuthenticationSystemAPI","owner":"anmol420","description":"An Authentication System designed in Spring Security.","archived":false,"fork":false,"pushed_at":"2025-06-11T11:10:15.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-11T11:51:29.128Z","etag":null,"topics":["authentication-backend","docker-compose","java","postgresql","spring-boot","spring-data-jpa","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/anmol420.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-06-08T12:21:37.000Z","updated_at":"2025-06-11T11:10:18.000Z","dependencies_parsed_at":"2025-06-11T12:02:52.606Z","dependency_job_id":null,"html_url":"https://github.com/anmol420/AuthenticationSystemAPI","commit_stats":null,"previous_names":["anmol420/authenticationsystemapi"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/anmol420/AuthenticationSystemAPI","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anmol420%2FAuthenticationSystemAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anmol420%2FAuthenticationSystemAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anmol420%2FAuthenticationSystemAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anmol420%2FAuthenticationSystemAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anmol420","download_url":"https://codeload.github.com/anmol420/AuthenticationSystemAPI/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anmol420%2FAuthenticationSystemAPI/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259659774,"owners_count":22891683,"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":["authentication-backend","docker-compose","java","postgresql","spring-boot","spring-data-jpa","spring-security"],"created_at":"2025-06-13T14:16:07.187Z","updated_at":"2026-05-03T17:32:49.389Z","avatar_url":"https://github.com/anmol420.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spring Boot Authentication System\n\nThis is a secure and minimal authentication system built using **Spring Boot**, **Spring Security**, **Spring Data JPA**, **PostgreSQL**, and **Docker Compose**. It includes basic routes for user registration, login, logout, and access to a protected dashboard. It uses **cookie-based authentication** to maintain session security.\n\n---\n\n## Features\n\n-  Secure login and registration\n-  Cookie-based session authentication\n-  JWT token handling (with custom error handling)\n-  PostgreSQL database integration\n-  Docker Compose setup for easy database deployment\n\n---\n\n## Tech Stack\n\n- Java 21\n- Spring Boot\n- Spring Security\n- Spring Data JPA\n- PostgreSQL\n- Docker \u0026 Docker Compose\n\n---\n\n## Getting Started\n\n### Prerequisites\n\n- Java 21\n- Maven\n- Docker \u0026 Docker Compose\n\n### Clone the Repository\n\n```bash\n  git clone https://github.com/your-username/spring-auth-system.git\n  cd spring-auth-system\n```\n\n### Setup PostgreSQL with Docker\n\nUse the provided `docker-compose.yml` to spin up a PostgreSQL container:\n\n```bash\n  docker-compose up -d\n```\n\nDefault credentials (defined in `application.properties`):\n\n- **Username:** `postgres`\n- **Password:** `changemeinprod!`\n- **DB Name:** `auth_system`\n\nMake sure your Spring Boot app connects to this database.\n\n### Run the Application\n\n```bash\n  ./mvnw spring-boot:run\n```\n\n---\n\n## API Endpoints\n\n### 1. Register\n\n```http\nPOST /auth/register\n```\n\n**Request Body:**\n\n```json\n{\n  \"username\": \"your_username\",\n  \"password\": \"your_password\"\n}\n```\n\n### 2. Login\n\n```http\nPOST /auth/login\n```\n\n**Request Body:**\n\n```json\n{\n  \"username\": \"your_username\",\n  \"password\": \"your_password\"\n}\n```\n\n**Response:** Sets a JWT cookie if successful.\n\n### 3. Logout\n\n```http\nPOST /auth/logout\n```\n\nLogs the user out and clears the cookie.\n\n### 4. Dashboard (Protected)\n\n```http\nGET /dashboard\n```\n\nRequires authentication via cookie.\n\n---\n\n## Configuration\n\nAll environment settings (like DB URL, JWT expiration, etc.) can be configured in `application.properties`.\n\n---\n\n## Troubleshooting\n\n- **403 Forbidden:** Check if the JWT cookie is present and valid.\n- **Password Error:** Ensure password is Bcrypt encoded.\n- **CORS issues:** Make sure the frontend origin is allowed in your CORS configuration.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanmol420%2Fauthenticationsystemapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanmol420%2Fauthenticationsystemapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanmol420%2Fauthenticationsystemapi/lists"}