{"id":23228993,"url":"https://github.com/barcodehub/login-advanced-google-node","last_synced_at":"2025-10-28T21:14:04.691Z","repository":{"id":251794878,"uuid":"836312167","full_name":"Barcodehub/login-advanced-google-node","owner":"Barcodehub","description":"Secure Login API offering robust authentication features like Two-Factor Authentication (2FA), Google OAuth, CSRF protection, and advanced security measures to safeguard modern applications.","archived":false,"fork":false,"pushed_at":"2024-08-06T20:01:08.000Z","size":4730,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-11T15:53:30.417Z","etag":null,"topics":["2fa","2fa-security","auth","bcrypt","connect-mongo","csrf-protection","csurf","express-session","helmet","jwt-authentication","mongo-sanitize","oauth20","passport-google","rate-limiting","speakeasy","xss-clean"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/Barcodehub.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":"2024-07-31T15:21:50.000Z","updated_at":"2024-09-28T01:19:36.000Z","dependencies_parsed_at":"2025-02-11T15:53:25.251Z","dependency_job_id":"d2568f4e-79d2-48d5-8024-3b13d94bffff","html_url":"https://github.com/Barcodehub/login-advanced-google-node","commit_stats":null,"previous_names":["barcodehub/login-advanced-google-node"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Barcodehub%2Flogin-advanced-google-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Barcodehub%2Flogin-advanced-google-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Barcodehub%2Flogin-advanced-google-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Barcodehub%2Flogin-advanced-google-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Barcodehub","download_url":"https://codeload.github.com/Barcodehub/login-advanced-google-node/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247382980,"owners_count":20930191,"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":["2fa","2fa-security","auth","bcrypt","connect-mongo","csrf-protection","csurf","express-session","helmet","jwt-authentication","mongo-sanitize","oauth20","passport-google","rate-limiting","speakeasy","xss-clean"],"created_at":"2024-12-19T01:15:49.932Z","updated_at":"2025-10-03T16:20:21.682Z","avatar_url":"https://github.com/Barcodehub.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Secure Login API\n\n## Description\nSecure Login API is a robust and secure backend application developed with Node.js and Express. It provides a comprehensive authentication system with advanced security features, including Two-Factor Authentication (2FA) and Google OAuth integration.\n\n## Key Features\n- User registration\n- Secure login\n- Two-Factor Authentication (2FA)\n- Google OAuth integration\n- CSRF protection\n- Rate limiting\n- Input sanitization\n- NoSQL injection prevention\n- Secure HTTP headers with Helmet\n\n## Technologies Used\n- Node.js\n- Express\n- MongoDB\n- Mongoose\n- JSON Web Tokens (JWT)\n- Passport.js\n- Speakeasy (for 2FA)\n- Helmet\n- Express Rate Limit\n\n\n## Installation\nInstall dependencies:\nnpm install\n\n## Configuration\nCreate a `.env` file in the root directory with the following variables:\n```\nPORT=3000\nMONGODB_URI=mongodb://localhost:27017/secureLoginApp\nJWT_SECRET=tu_secreto_jwt_super_seguro\nSESSION_SECRET=tu_secreto_de_sesion_super_seguro\nGOOGLE_CLIENT_ID=tu_google_client_id\nGOOGLE_CLIENT_SECRET=tu_google_client_secret\nNODE_ENV=development\n```\nMake sure to replace the values with your own credentials and configurations.\n\n## Usage\nTo start the server:\n```\nnpm start\n```\n\n# API Endpoints\n\n## `GET /api/auth/csrf-token`: \nGenerate X-CSRF-Token\n\n## `POST /api/auth/signup`: User registration\n  ### Body (raw JSON):\n      \n              {\n              \"email\": \"user@example.com\",\n              \"password\": \"password123\"\n              }\n  ### Headers:\n\n  `X-CSRF-Token`: [CSRF Token obtained in step 1]\n    \n  `Content-Type`: application/json\n\n\n## `POST /api/auth/login`: User login\n\n  ### Body (raw JSON):\n     \n           {\n              \"email\": \"\",\n              \"password\": \"\"\n            }\n      \n   ### Headers:\n      \n  `X-CSRF-Token`: [Token CSRF obtenido en el paso 1]  \n                        \n  `Content-Type`: application/json\n  \n       \n## `POST /api/auth/logout`: User logout\n  ### Headers:\n      \n   `X-CSRF-Token`: [Token CSRF obtenido en el paso 1]\n  \n   `Authorization`: [Token JWT obtenido del login]\n  \n   `Content-Type`: application/json\n  \n\n## `POST /api/auth/generateTwoFactor`: Generate 2FA code\n  \n  `X-CSRF-Token`: [Token CSRF obtenido en el paso 1]\n  \n   `Authorization`: [Token JWT obtenido del login]\n  \n\n  Base64 representation of QR code (scan with auth app).\n  \n\n## `POST /api/auth/verifyTwoFactor`: Verify 2FA code\n\n  `X-CSRF-Token`: [Token CSRF obtenido en el paso 1]\n  \n  `Authorization`: [Token JWT obtenido del login]\n  \n  `Content-Type`: application/json\n  \n      \n  Body (raw JSON):\n      \n      {\n        \"token\": \"123456\"  // El código de 6 dígitos de tu app de autenticación\n      }\n      \n- `GET /api/auth/google`: Initiate Google authentication\n- `GET /api/auth/google/callback`: Google authentication callback\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarcodehub%2Flogin-advanced-google-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbarcodehub%2Flogin-advanced-google-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarcodehub%2Flogin-advanced-google-node/lists"}