{"id":18876214,"url":"https://github.com/keyvaluesoftwaresystems/authentication-service","last_synced_at":"2025-04-14T17:32:02.604Z","repository":{"id":37104379,"uuid":"365123252","full_name":"KeyValueSoftwareSystems/authentication-service","owner":"KeyValueSoftwareSystems","description":"A service to handle authentication and authorisation","archived":false,"fork":false,"pushed_at":"2023-04-21T20:15:52.000Z","size":1904,"stargazers_count":43,"open_issues_count":3,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2023-12-21T09:26:16.669Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KeyValueSoftwareSystems.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-07T05:25:05.000Z","updated_at":"2023-12-05T07:49:59.000Z","dependencies_parsed_at":"2023-02-16T18:46:03.688Z","dependency_job_id":null,"html_url":"https://github.com/KeyValueSoftwareSystems/authentication-service","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KeyValueSoftwareSystems%2Fauthentication-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KeyValueSoftwareSystems%2Fauthentication-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KeyValueSoftwareSystems%2Fauthentication-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KeyValueSoftwareSystems%2Fauthentication-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KeyValueSoftwareSystems","download_url":"https://codeload.github.com/KeyValueSoftwareSystems/authentication-service/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223639328,"owners_count":17177816,"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":[],"created_at":"2024-11-08T06:11:41.423Z","updated_at":"2024-11-08T06:11:41.985Z","avatar_url":"https://github.com/KeyValueSoftwareSystems.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Authentication Service\n\nA standalone service to handle authentication and authorization.\n\u003cp  align=\"center\"\u003e\n\u003cimg src=\"https://www.keyvalue.systems/logo.png\" width=\"290\" height=\"100\"\u003e\n\u003c/p\u003e\n\u0026nbsp;\n\u003cp  align=\"center\"\u003e\n\u003ca  href=\"https://gitlab.com/keyvalue-systems/authentication-service/-/pipelines\"  target=\"_blank\"\u003e\u003cimg  src=\"https://gitlab.com/keyvalue-systems/authentication-service/badges/master/pipeline.svg?key_text=build\"  alt=\"build status\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n  \n\n## Description\n\nUser signup, authentication and authorization are integral parts of any SAAS product. When we kick start a new product development we can either use services like AWS cognito , Auth0 etc or build ourselves to achieve this, Even if we use external services we end up writing a wrapper. This service tries to implement the user authentication and authorization features needed for any application.\n\nService can be used as mentioned below\n-   Deploy as a standalone service for managing authentication and authorization   \n-   Use it as a starting point for new product development and build new features on top of it.\n \nDevelopers can customise this as per their requirement.\n\n## Features\n\n-   Signup using phone number/email and password\n-   Login using phone number/email and password\n-   Signup using phone number/email and OTP (custom totp + message via sendgrid / twilio)\n-   Validating OTP\n-   Recaptcha v2 and v3 implementation\n-   Signup using google\n-   Authentication using JWT access token\n-   Ability to refresh the token\n-   Option to change password\n-   Managing groups\n-   Assign user to a group\n-   Manage permissions for different apis\n-   Assigning permissions to a group or individual user.\n-   Authorize a user based on their permissions(direct permissions and group permissions)\n \n## Tech stack \n\n-   [NodeJS](https://nodejs.org/en/)\n-   [NestJS](https://nestjs.com/)\n-   [Redis](https://redis.io/)\n-   [Postgresql](https://www.postgresql.org/)\n-   [Apollo Graphql](https://www.apollographql.com/)\n-   [Docker](https://www.docker.com/)\n-   [Sendgrid](https://sendgrid.com/)\n-   [Twilio](https://www.twilio.com/)\n\n## Getting Started\n\n-   Clone the repo and execute command `npm install`\n-   Create a copy of the env.sample file and rename it as .env\n-   Install postgres and redis\n-   Provide postgres, redis secrets and default user details in .env file as mentioned below\n\n| Database configuration(Required) |  |\n|--|--|\n|POSTGRES_HOST  | localhost |\n|POSTGRES_PORT  |  5432|\n|POSTGRES_USER  | postgres |\n|POSTGRES_PASSWORD  | postgres |\n|POSTGRES_DB  | auth_service |\n\n\u0026nbsp;\n|Redis Cache configuration(Required)  |  |\n|--|--|\n|REDIS_HOST  | localhost |\n|REDIS_PORT |6379  |\n|REDIS_CACHE_TTL | 3600 |\n|REDIS_MAX_ITEM_IN_CACHE  |1000  |\n\n\u0026nbsp;\n| Authentication Configuration(Required) |  |\n|--|--|\n|OTP_SECRET|  secret|\n|JWT_TOKEN_EXPTIME|3600  |\n|JWT_REFRESH_TOKEN_EXP_TIME| 36000 |\n|ENV  |  local|\n\n  \u0026nbsp;\n| Other Configuration(Required) |  |\n|--|--|\n|PORT|4000  |\n|DEFAULT_ADMIN_PASSWORD|Should be atleast 10 characters|\n\n  \u0026nbsp;\n|Google social login Configuration(Optional)|  |\n|--|--|\n|GOOGLE_CLIENT_ID  |  |\n|GOOGLE_SECRET  |  |\n|APP_URL  | the URL of the application to which the redirect should happen |\n\n\u0026nbsp;\n|Google recaptcha Configuration(Optional) |  |\n|--|--|\n|RECAPTCHA_SECRET_KEY | secret |\n|RECAPTCHA_VERIFY_URL  | https://www.google.com/recaptcha/api/siteverify |\n|MIN_RECAPTCHA_SCORE  |Required for Recaptcha V3  |\n\n  \u0026nbsp;\n|OTP Sender Configuration(Optional)  |  |\n|--|--|\n|IS_TWILIO_INTEGRATED  | false |\n|TWILIO_ACC_SID  | required only if you are using any twilio service(sms sender or verify tool) |\n|TWILIO_AUTH_TOKEN  | required only if you are using any twilio service(sms sender or verify tool) |\n|TWILIO_SENDING_NUMBER  | required only if you are using any twilio service(sms sender or verify tool) |\n|OTP_VERIFY_TOOL| twilio or default|\n|TWILIO_VERIFY_SID| required only if otp verify tool is twilio |\n|SMS_INTEGRATION|twilio or aws|\n| OTP_WINDOW | 300  |\n| OTP_STEP | 1 |\n\n-   Run `npm run run-migrations`\n-   Run `npm run start`\n-   Service should be up and running in http://localhost:${PORT}.\n- A default admin user with email **admin@domain.com** and password given in `DEFAULT_ADMIN_PASSWORD` will already be available in the application. This user will be associated to the default `Admin` group which will have the permissions to create/update permissions, create/update groups, create/update entities and update a user\n    \n\nWe can ensure the health of the service by accessing http://localhost:${PORT}/auth/api/health.\n\n## Google Social login\n\nInorder to login by Google, access the following URL in browser http://localhost:4000/auth/api/google \n## GraphQL API reference\n\nGraphQL endpoint\n\nhttp://localhost:${PORT}/auth/api/graphql\n\n[API Documentation](https://documenter.getpostman.com/view/10091423/U16ev8cG)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeyvaluesoftwaresystems%2Fauthentication-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeyvaluesoftwaresystems%2Fauthentication-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeyvaluesoftwaresystems%2Fauthentication-service/lists"}