{"id":18441647,"url":"https://github.com/stefanwalther/auth-service","last_synced_at":"2025-04-07T22:32:27.922Z","repository":{"id":39388284,"uuid":"82202137","full_name":"stefanwalther/auth-service","owner":"stefanwalther","description":"Generic authentication service.","archived":false,"fork":false,"pushed_at":"2023-03-01T05:01:12.000Z","size":686,"stargazers_count":6,"open_issues_count":38,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-03T17:54:31.046Z","etag":null,"topics":["auth","auth0","authentication","jwt","microservices","sammler"],"latest_commit_sha":null,"homepage":null,"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/stefanwalther.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGE_LOG.yaml","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":"2017-02-16T16:36:52.000Z","updated_at":"2023-12-19T17:39:58.000Z","dependencies_parsed_at":"2024-11-06T06:40:05.591Z","dependency_job_id":"0a4fcc83-9db2-4636-8ae1-7c4164d3bf28","html_url":"https://github.com/stefanwalther/auth-service","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanwalther%2Fauth-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanwalther%2Fauth-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanwalther%2Fauth-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanwalther%2Fauth-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stefanwalther","download_url":"https://codeload.github.com/stefanwalther/auth-service/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247741528,"owners_count":20988423,"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":["auth","auth0","authentication","jwt","microservices","sammler"],"created_at":"2024-11-06T06:38:55.513Z","updated_at":"2025-04-07T22:32:24.910Z","avatar_url":"https://github.com/stefanwalther.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# auth-service\n\n\u003e Auth service.\n\n[![CircleCI](https://img.shields.io/circleci/project/github/stefanwalther/auth-service.svg)](https://circleci.com/gh/stefanwalther/auth-service)\n[![XO code style](https://img.shields.io/badge/code_style-XO--space-5ed9c7.svg)](https://github.com/sindresorhus/eslint-config-xo-space)\n\n---\n\u003cbr/\u003e\n\u003cbr/\u003e\n## !!! NOTHING TO SHOW, YET. WORK IN PROGRESS. !!!\n\u003cbr/\u003e\n\u003cbr/\u003e\n---\n\n## Summary\n_auth-service_ is a tiny, re-usable authentication service to be used in any microservices' environment.\n\nIt is built on top of [express](https://expressjs.com/) , [passport](http://passportjs.org/) and [JWT](https://jwt.io/), therefore easy to extend and integrate.\n\n### Basic functionality\n\n- [x] Registration of a user\n- [x] Login (and return a JWT token)\n- [x] Verify JWT token\n- [x] Logout\n- [x] Mark a user as deleted (cannot login anymore)\n- [x] Mark a user as undeleted (can login again)\n- [x] Verify the users email\n- [ ] Send password reset email\n- [ ] Password reset\n- [ ] Return the user's profile\n\n### Authentication Providers\n\n- [x] Local database (MongoDB)\n\n### Social Authentication Providers\n\nCurrent, only the local strategy is implemented (saving the user in the given MongoDB instance), but it should be pretty straightforward to extend _auth-service_ with other authentication provider, such as:\n\n- GitHub \n- auth0\n- saml\n- oauth/oauth2\n- DropBox\n- Google\n- Facebook\n- LinkedIn\n- OpenId\n- ...\n\nJust have a look at [passports.js](http://passportjs.org/) and the supported strategies.\n\n## Installation\n```bash\n$ docker run -it stefanwalther/auth-service\n```\n\n## Configuration\n_auth-service_ can be configured by the following environment variables:\n\n**General:**\n\n- `PORT` - The port to run the REST API (defaults to `3010`).\n- `JWT_SECRET` - The secret used for JWT, defaults to `foo`'\n- `NODE_ENV` - Environment settings for the service (`production`, `development` or `test`), defaults to `development`.\n\n**Features:**\n- `ENABLE_AUDIT_LOG` - Enable or disable audit-log.\n- `REGISTRATION__DOMAIN_FILTER` - Filter domains for the registration process, can be a wildcard ('*'), a single domain (e.g. 'foo.bar') or a list of domains (e.g. 'foo.com,bar.com')\n\n**MongoDB:**\n\nProvide the connection to MongoDB either by providing a full connection string:\n\n- `MONGODB_CONNECTION_STRING` - The full MongoDB connection string.\n\nor by providing details of the connection:\n\n- `MONGODB_DATABASE` - The MongoDB database, defaults to `db`.\n- `MONGODB_HOST` - MongoDB host, defaults to `localhost`.\n- `MONGODB_PORT` - MongoDB port, defaults to `27017`. \n- `MONGODB_DEBUG` - Whether to use the Mongoose debug mode or not, defaults to `false`.\n\n**NATS-Streaming:**\n\n- `NATS_STREAMING_HOST` - The NATS-Streaming host, defaults to `localhost`.\n- `NATS_STREAMING_PORT` - The NATS-Streaming port, defaults to `4222`.\n\n**Nodemailer:**\n(e.g for sending an account verification message):\n\n- `NODEMAILER_TRANSPORT` - The transport for Nodemailer (possible options: `postmark`).\n\nDepending on the transporter for Nodemailer the following options can be set:\n\nPostmark:\n\n- `POSTMARK_API_TOKEN` - Postmark`s Server API Token.\n\nNodemailer settings only need to be set if **one** of the following options are set to `true`:\n\n## Usage\n\n## API\n\nAll endpoints are documented through OpenApi/Swagger using\n\nhttp://localhost:3010/api-docs\n\n## Contribute\n\n\u003cdetails\u003e\n\u003csummary\u003eDevelopment environment\u003c/summary\u003e\n\n### Start the development environment\n\nTo start the development environment, go for\n\n```sh\n$ make up\n```\n\nThis will essentially:\n\n- Start MongoDB\n- Start RabbitMQ (management UI available at: http://localhost:15672/)\n- Start a server running the auth-service (http://localhost:3010)\n- Watch changes and re-start the server\n\n### Only required services\n\nIf you only want to run required services (e.g. MongoDB, RabbitMQ, etc.) and run the node.js process on your machine, then go for\n\n```sh\n$ make up-deps\n```\n\nThen start the server using\n\n```sh\n$ npm run start:watch\n```\n\nThe API is available at http://localhost:3010\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eRun tests\u003c/summary\u003e\n\n### Run tests\n\nRunning and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:\n\n**Start MongoDB**:  \nThe following command will spin up a MongoDB instance to be used in the **integration tests** at port 27018 (to prevent conflicts with the default port).\n\n```sh\n$ npm run dc-dev-up\n```\n\n---\n\nThen run one of the following options:\n\n**Run integration tests**:\n\nSpins up all required dependent services to run the integration tests and runs the integration tests:\n\n```sh\n$ make build-run-integration-tests\n```\n\n**Run unit tests**:\n```sh\n$ make build-run-unit-tests\n```\n\n---\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eUpdate docs \u0026 readme\u003c/summary\u003e\n\n### Building docs\n\n_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_\n\nTo generate the readme, run the following command:\n\n```sh\nmake gen-readme\n```\n\u003c/details\u003e\n\n## About\n\n### Author\n**Stefan Walther**\n\n* [github/stefanwalther](https://github.com/stefanwalther)\n* [twitter/waltherstefan](http://twitter.com/waltherstefan)\n\n## License\nMIT\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstefanwalther%2Fauth-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstefanwalther%2Fauth-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstefanwalther%2Fauth-service/lists"}