{"id":16989540,"url":"https://github.com/jottenlips/tinyauth","last_synced_at":"2025-04-12T04:10:13.303Z","repository":{"id":38225075,"uuid":"257073724","full_name":"jottenlips/tinyauth","owner":"jottenlips","description":"📱 A tiny passwordless SMS authentication service using Flask, JWT, Serverless, DynamoDB, Ariadne GraphQL","archived":false,"fork":false,"pushed_at":"2023-03-04T13:16:36.000Z","size":4149,"stargazers_count":5,"open_issues_count":17,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-05T16:38:08.249Z","etag":null,"topics":["ariadne","auth","authentication","aws","boto3","dynamo","dynamodb","dynamodb-table","graphql","jwt","microservice","moto","one-table","passwordless","python","serverless","sms","sns","tinyauth"],"latest_commit_sha":null,"homepage":"https://tinyauth.io/graphql","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/jottenlips.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":null,"patreon":"jottenlips","open_collective":null,"ko_fi":"johnottenlips","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2020-04-19T18:31:58.000Z","updated_at":"2023-03-08T16:17:58.000Z","dependencies_parsed_at":"2023-02-15T04:16:46.163Z","dependency_job_id":null,"html_url":"https://github.com/jottenlips/tinyauth","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jottenlips%2Ftinyauth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jottenlips%2Ftinyauth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jottenlips%2Ftinyauth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jottenlips%2Ftinyauth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jottenlips","download_url":"https://codeload.github.com/jottenlips/tinyauth/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248514221,"owners_count":21116903,"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":["ariadne","auth","authentication","aws","boto3","dynamo","dynamodb","dynamodb-table","graphql","jwt","microservice","moto","one-table","passwordless","python","serverless","sms","sns","tinyauth"],"created_at":"2024-10-14T03:07:01.194Z","updated_at":"2025-04-12T04:10:13.274Z","avatar_url":"https://github.com/jottenlips.png","language":"Python","readme":"![](tinyauthlogo.png)\n\ntinyauth is a very tiny passwordless GraphQL authentication service. tinyauth keeps authentication simple with 3 easy steps. \n\n(This is a toy, don't use for production)\n\n## Step 1\n\n- sends code to user's phone\n\n```graphql\nmutation {\n  sendVerification(phone: \"+15559993478\", message: \"Howdy! your code is\") {\n    status # 200\n    message # verification sent\n    success # true\n  }\n}\n```\n\n## Step 2\n\n- verify phone with code user received as sms\n\n```graphql\nmutation {\n  verifyUser(verification: { phone: \"+15559993478\", code: \"555555\" }) {\n    status\n    message\n    success\n    auth # auth jwt to include in future headers\n  }\n}\n```\n\n## Step 3\n\n- place jwt in headers {\"auth\": \"auth-jwt-from-last-step\"}\n\n- run the `getMe` query\n\n```graphql\n{\n  getMe {\n    id\n    phone\n  }\n}\n```\n\n### Develop\n\nSet up your .aws credentials, make a DynamoDB table named tinyauth-dev\n\nInstall node (to run serverless-offline). I use nvm to manage my node versions.\n\nGo to your tinyauth-api folder:\n\n`touch .env`\n\nAdd TABLE_NAME and API_SECRET environment variables.\n\n```console\nTABLE_NAME=my-app-dev\nAPI_SECRET=somethingsecret\n```\n\n`npm install`\n\n`virtualenv -p python3 venv`\n\n`source venv/bin/activate`\n\n`pip install -r requirements.txt`\n\n`sls deploy` - will automatically make your dynamodb table on aws.\n\n`sls wsgi serve -p 8000` or `yarn run start`\n\nRun queries in Graphi at http://localhost:8000/graphql\n\n### Run Tests\n\n`TABLE_NAME=tinyauth-test API_SECRET=somethingsecret python -m pytest` or `yarn run test`\n\n### Deploy\n\nUpdate your table name / secret in .env and run\n\n```console\nsls deploy\n```\n\n### No GraphQL Client?\n\n#### Send verification\n\n```python\nimport requests\n\nvariables = {'phone': '+155555555555'}\nmutation = \"\"\"\nmutation SendVerification($phone: String!) {\n  sendVerification(phone: $phone) {\n    status\n    message\n    success\n  }\n}\n\"\"\"\n\n# or localhost:8000 for dev\nrequests.post('https://tinyauth.io/graphql', json={'query': mutation, 'variables': variables})\n```\n\n#### Verify user\n\n```python\nimport requests\n\nvariables = {'phone': '+155555555555', 'code': '555555'}\nmutation = \"\"\"\nmutation VerifyUser($phone: String!, $code: String!) {\n  verifyUser(verification: { phone: $phone, code: $code }) {\n    status\n    message\n    success\n    auth # auth jwt to include in future headers\n  }\n}\n\"\"\"\n\n# or localhost:8000 for dev\nrequests.post('https://tinyauth.io/graphql', json={'query': mutation, 'variables': variables})\n```\n\n#### Get Me\n\n```python\nimport requests\n\nheaders = {\n  \"auth\": your-tinyauth-jwt\n}\n\nquery = \"\"\"\n{\n  getMe {\n    id\n    phone\n  }\n}\n\"\"\"\n\n# or localhost:8000 for dev\nrequests.post('https://tinyauth.io/graphql', json={'query': query}, headers=headers)\n```\n","funding_links":["https://patreon.com/jottenlips","https://ko-fi.com/johnottenlips"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjottenlips%2Ftinyauth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjottenlips%2Ftinyauth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjottenlips%2Ftinyauth/lists"}