{"id":23038664,"url":"https://github.com/ark948/fastapi-auth-project","last_synced_at":"2025-10-15T15:25:28.963Z","repository":{"id":260332923,"uuid":"880464961","full_name":"ark948/fastapi-auth-project","owner":"ark948","description":"Simple fastapi app to demonstrate token authentication process","archived":false,"fork":false,"pushed_at":"2024-11-09T18:58:07.000Z","size":88,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-07T08:53:12.516Z","etag":null,"topics":["fastapi","jwt","jwt-authentication","python","sqlmodel","token-based-authentication"],"latest_commit_sha":null,"homepage":"","language":"Python","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/ark948.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-10-29T19:17:51.000Z","updated_at":"2025-08-15T13:35:10.000Z","dependencies_parsed_at":"2024-12-15T18:32:48.575Z","dependency_job_id":null,"html_url":"https://github.com/ark948/fastapi-auth-project","commit_stats":null,"previous_names":["ark948/fastapi-auth-project"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ark948/fastapi-auth-project","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ark948%2Ffastapi-auth-project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ark948%2Ffastapi-auth-project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ark948%2Ffastapi-auth-project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ark948%2Ffastapi-auth-project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ark948","download_url":"https://codeload.github.com/ark948/fastapi-auth-project/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ark948%2Ffastapi-auth-project/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279086465,"owners_count":26100158,"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","status":"online","status_checked_at":"2025-10-15T02:00:07.814Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["fastapi","jwt","jwt-authentication","python","sqlmodel","token-based-authentication"],"created_at":"2024-12-15T18:20:06.619Z","updated_at":"2025-10-15T15:25:28.939Z","avatar_url":"https://github.com/ark948.png","language":"Python","readme":"### Authentication api from official fastapi documentation\n\nThe internal code did not change, only the structure...\n\n\nInstallation\n\n1. Initialize a virtual environemnt (i will use venv):\n\n    `python -m venv \u003cenvName\u003e`\n    \n2. Install required python packages:\n\n    `pip install -r requirements.txt`\n    \n3. navigate to backend folder, and use runserver.py to run the server:\n\n    `cd backend`\\\n    `python runserver.py`\n\n\n\n#### Authentication Process:\n1. User submites info --\u003e auth \u003e create route (Registration)\\\n    (serialization and validation is controlled by auth \u003e schemas \u003e CreateUser pydantic model)\n\n    (only email and password are required)\n\n2. create route --\u003e calls auth \u003e crud \u003e create\\\n    (plain password will be hashed)\n\n    2.1 auth \u003e crud \u003e create --\u003e auth \u003e utils \u003e generateOtp\\\n    (a 7 digit random number will be generated to use for email verification purposes)\\\n    (user object will be created and inserted into database, user table)\\\n    (the verification code will be emailed to user)\\\n    (Registration process is finished here)\\\n    (if email verification is mandatory continue to next step, if not skip to step 4)\n\n3. User receives verification code from email --\u003e submites the code to auth \u003e verify-user\n\n    (since there are no letters in verification code, input could be integer only)\\\n    (serialization and validation by auth \u003e schemeas \u003e VerifyUser pydantic model)\\\n    (if code is correct, 'is_active' property of user object will be set to true)\\\n    (code property of user object will be set to an empty string)\n\n4. User submits info --\u003e auth \u003e login route (Logging in)\\\n    (serialization and validation is controlled automatically by OAuth2PasswordRequestForm)\n\n    4.1 auth \u003e login --\u003e oauth2 \u003e authenticate_user\\\n    (takes email and password and db session)\n\n    4.2 oauth2 \u003e authenticate_user --\u003e oauth2 \u003e get_user\\\n    (get_user will take only email and session, aquires user object from email, passes it back to authenticate_user)\n\n    4.3 oauth2 \u003e authenticate_user --\u003e hash \u003e verify_password\\\n    (hash \u003e verify_password will compare submitted plain password with hashed password from database)\\\n    (returns true back to authenticate_user if password is correct)\n\n    4.4 hash \u003e verification --\u003e oauth \u003e authenticate_user\\\n    (authenticate_user will return the user object back to auth \u003e login route)\n\n    4.5 oauth \u003e authenticate_user --\u003e auth \u003e login\\\n    (login will create a timedelta and passes it to create_access_token along with user's email)\n\n    4.6 auth \u003e login --\u003e tokens \u003e create_access_token\\\n    (create_access_token will generate an access token and passes it back to auth \u003e login)\n\n    4.7 tokens \u003e create_access_token --\u003e auth \u003e login\n\n    4.8 auth \u003e login --\u003e tokens \u003e Token\\\n    (auth \u003e login will create a token object validated by tokens \u003e Token pydantic model)\n    \n    4.9 auth \u003e login --\u003e returns token\\\n    (auth \u003e login will return token)\n\n\n5. auth \u003e login will return token\\\n    (Frontend will recieve token)\\\n    (Frontend will save the token in either cookie or LocalStorage)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fark948%2Ffastapi-auth-project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fark948%2Ffastapi-auth-project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fark948%2Ffastapi-auth-project/lists"}