{"id":22560498,"url":"https://github.com/timonrieger/auth-service","last_synced_at":"2026-05-01T15:36:50.362Z","repository":{"id":282857903,"uuid":"882863525","full_name":"timonrieger/auth-service","owner":"timonrieger","description":"Authentication microservice built with flask","archived":false,"fork":false,"pushed_at":"2025-03-17T09:33:19.000Z","size":64,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-17T10:38:36.752Z","etag":null,"topics":["authentication-backend","flask"],"latest_commit_sha":null,"homepage":"https://auth.timonrieger.de/app","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/timonrieger.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-03T23:55:07.000Z","updated_at":"2025-03-17T09:33:23.000Z","dependencies_parsed_at":"2025-03-17T10:49:32.267Z","dependency_job_id":null,"html_url":"https://github.com/timonrieger/auth-service","commit_stats":null,"previous_names":["timonrieger/auth-service"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timonrieger%2Fauth-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timonrieger%2Fauth-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timonrieger%2Fauth-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timonrieger%2Fauth-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timonrieger","download_url":"https://codeload.github.com/timonrieger/auth-service/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246026111,"owners_count":20711581,"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","flask"],"created_at":"2024-12-07T21:14:25.657Z","updated_at":"2026-05-01T15:36:45.329Z","avatar_url":"https://github.com/timonrieger.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Centralized Authentication Service\n\nThis project is a Flask-based centralized authentication service that provides user registration, login, and email confirmation functionalities. It uses the [`database-service`](https://github.com/timonrieger/database-service.git) as database schema.\n\n## Features\n\n- User registration with email confirmation\n- User login with password hashing\n- Email token generation and validation for account confirmation\n- Email and password changes\n- Password reset management\n- Redirect URLs for seamless UX\n- API Key management (creation and verification)\n- User management frontend to give the user full control about his account\n- Data export\n\n## Limitations\n\n- No user account deletion\n\n## Requirements\n\n- Flask\n- Flask-SQLAlchemy\n- Werkzeug\n- python-dotenv\n\n## Setup\n\n1. Clone the repository:\n\t```sh\n\tgit clone https://github.com/timonrieger/auth-service.git\n\tcd auth-service\n\t```\n\n2. Create a virtual environment and activate it:\n\t```sh\n\tpython -m venv venv\n\tsource venv/bin/activate  # On Windows use `venv\\Scripts\\activate`\n\t```\n\n3. Install the required packages:\n\t```sh\n\tpip install -r requirements.txt\n\t```\n\n4. Create a `.env` file in the root directory and add your configuration settings. Use the database URL provided by your hosting service. Ensure the connection string matches the one used in the database:\n\t```env\n\tSECRET_KEY=your_secret_key\n\tDB_URI=your_database_uri\n\t```\n\n5. Run the application:\n\t```sh\n\tpython3 -m main\n\t```\n\n## Usage\n\n### Register a new user\n\nSend a POST request to `/register` with the following parameters:\n- `email`\n- `password`\n- `username`\n- `then` (URL to redirect after account confirmation)\n\n```python\ndata = {\"email\": email, \"password\": password, \"username\": username, \"then\": \"https://YOURDOMAIN/login\"}\nresponse = requests.post(f\"{AUTH_URL}/register\", json=data)\n```\n\n### Login\n\nSend a POST request to `/login` with the following parameters:\n- `email`\n- `password`\n\n```python\ndata = {\"email\": email, \"password\": password}\nresponse = requests.post(url=AUTH_URL, json=data)\n```\n\n\n### Create API Key\n\nSend a POST request to `/apikey/create` with the following parameters:\n- `id` (user ID)\n\n```python\ndata = {\"id\": id}\nresponse = requests.post(url=f\"{AUTH_URL}/apikey/create\", json=data)\n```\n\n### Verify API Key\n\nSend a GET request to `/apikey/verify` with the authorization header:\n- `Authorization` (no Bearer prefix)\n\n```python\nheaders = {'Authorization': token}\nresponse = requests.get(url=f\"{AUTH_URL}/apikey/verify\", headers=headers)\n```\n\n### Response\n\nReturns status code 200 on success. Anything else is considered to be an error. The response also always contains a message.\n```python\nresponse.status_code\nresponse.json()['message']\n```\n\n### Example\n\nYour code might look like this for logging a user in (using flask and flask_login):\n```python\nresponse = requests.post(url=f\"{AUTH_URL}/login\", json=data)\nif response.status_code == 200:\n\tflash(response.json()['message'], \"success\")\n\tlogin_user(user)\n\treturn redirect(url_for(\"home\"))\nflash(response.json()['message'], \"error\")\n```\n\n## Configuration\n\nYou will have to change the email content in `utils.py` by updating the urls and my name. You can update anything else as well.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimonrieger%2Fauth-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimonrieger%2Fauth-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimonrieger%2Fauth-service/lists"}