{"id":16174934,"url":"https://github.com/app-generator/sample-flask-auth-social","last_synced_at":"2025-06-26T14:31:45.329Z","repository":{"id":100503197,"uuid":"453359491","full_name":"app-generator/sample-flask-auth-social","owner":"app-generator","description":"Flask Social Login - Github \u0026 Twitter | AppSeed","archived":false,"fork":false,"pushed_at":"2023-07-04T15:05:21.000Z","size":46,"stargazers_count":8,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-23T16:18:37.102Z","etag":null,"topics":["appseed-sample","flask-sample","oauth2"],"latest_commit_sha":null,"homepage":"https://blog.appseed.us/flask-social-authentication-github-twitter/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/app-generator.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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":"2022-01-29T09:59:38.000Z","updated_at":"2024-08-01T00:11:42.000Z","dependencies_parsed_at":"2024-10-27T19:21:12.840Z","dependency_job_id":"602e6c72-8931-47fc-930d-bafeb6540d97","html_url":"https://github.com/app-generator/sample-flask-auth-social","commit_stats":null,"previous_names":[],"tags_count":1,"template":true,"template_full_name":null,"purl":"pkg:github/app-generator/sample-flask-auth-social","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/app-generator%2Fsample-flask-auth-social","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/app-generator%2Fsample-flask-auth-social/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/app-generator%2Fsample-flask-auth-social/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/app-generator%2Fsample-flask-auth-social/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/app-generator","download_url":"https://codeload.github.com/app-generator/sample-flask-auth-social/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/app-generator%2Fsample-flask-auth-social/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262084635,"owners_count":23256276,"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":["appseed-sample","flask-sample","oauth2"],"created_at":"2024-10-10T04:43:48.103Z","updated_at":"2025-06-26T14:31:45.294Z","avatar_url":"https://github.com/app-generator.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [Flask Social Login (Twitter \u0026 Github)](https://blog.appseed.us/flask-social-authentication-github-twitter/)\n\nOpen-source Flask Sample built on top of `flask-dance` library. The project implements the **[social login for Github and Twitter](https://blog.appseed.us/flask-social-authentication-github-twitter/)** - Originally coded by _[TestDriven.IO](https://github.com/testdrivenio/flask-social-auth)_.\n\n\u003cbr /\u003e\n\n\u003e ✨ Features:\n\n- `Up-to-date dependencies`\n- `OPENID` Social login over [Flask Dance](https://pypi.org/project/Flask-Dance/)\n  - **Github**\n  - **Twitter**\n- `SQLite` Persistence, `SQLAlchemy` ORM\n- Free [Support](https://appseed.us/support): email and [Discord](https://discord.gg/fZC6hup) (1k+ community).\n\n\u003cbr /\u003e\n\n![Flask Social Login - Free sample provided by AppSeed.](https://user-images.githubusercontent.com/51070104/151698261-659e49e4-46e0-4ea4-8412-2bc61e6aa8ca.jpg)\n\n\u003cbr /\u003e\n\n## ✨ Build from sources\n\n\u003e 👉 **Step #1** - Clone sources (this repo)\n\n```bash\n$ # Clone the sources\n$ git clone https://github.com/app-generator/sample-flask-auth-social.git\n$ cd sample-flask-auth-social\n```\n\n\u003cbr /\u003e\n\n\u003e 👉 **Step #2** - Create a virtual environment\n\n```bash\n$ # Virtualenv modules installation (Unix based systems)\n$ virtualenv env\n$ source env/bin/activate\n$\n$ # Virtualenv modules installation (Windows based systems)\n$ # virtualenv env\n$ # .\\env\\Scripts\\activate\n```\n\n\u003cbr /\u003e\n\n\u003e 👉 **Step #3** - Install dependencies\n\n```bash\n$ pip3 install -r requirements.txt\n```\n\n\u003cbr /\u003e\n\n\u003e 👉 **Step #4** - Set Up Environment\n\n```bash\n$ # Set the FLASK_APP environment variable\n$ (Unix/Mac) export FLASK_APP=run.py\n$ (Windows) set FLASK_APP=run.py\n$ (Powershell) $env:FLASK_APP = \".\\run.py\"\n```\n\n\u003cbr /\u003e\n\n\u003e 👉 **Step #5** - (optional) Enable DEBUG Environment (local development)\n\n```bash\n$ # Set up the DEBUG environment\n$ (Unix/Mac) export FLASK_ENV=development\n$ (Windows) set FLASK_ENV=development\n$ (Powershell) $env:FLASK_ENV = \"development\"\n```\n\n\u003cbr /\u003e\n\n\u003e 👉 **Github Setup** - [Create an OAuth App](https://docs.github.com/en/developers/apps/building-oauth-apps/creating-an-oauth-app)\n\n- SignIN to `Github`\n- Access `Settings` -\u003e `Developer Settings` -\u003e `OAuth Apps`\n- Edit your OAuth App\n  - `App Name`\n  - `App Description`\n  - (mandatory) `HomePage`: `https://localhost:5000`\n  - (mandatory) `Authorization callback URL`: `https://localhost:5000/login/github/authorized`\n  - Generate a new `secret key`\n\n\u003cbr /\u003e\n\n\u003e 👉 **Twitter Setup** - [Create an OAuth App](https://developer.twitter.com/en/portal/projects-and-apps)\n\n- SignIN to `Twitter`\n- Access `Developer Section` -\u003e https://developer.twitter.com/en/portal/projects-and-apps\n- Create a new APP\n- Edit User authentication settings\n  - Check `OAuth 1.0a`\n  - (mandatory) `HomePage`: `https://www.localhost:5000`\n  - (mandatory) `Authorization callback URL`: `https://127.0.0.1:5000/login/twitter/authorized`\n\n\u003cbr /\u003e\n\n\u003e 👉 **Update Environment** - Rename `.env.sample` to `.env` and edit the file\n\n- For GITHUB Login\n  - `GITHUB_ID` - value provided by `Github Setup`\n  - `GITHUB_SECRET` - value provided by `Github Setup`\n- For TWitter Login\n  - `TWITTER_ID` - value provided by `Twitter Setup`\n  - `TWITTER_SECRET` - value provided by `Twitter Setup`\n\n\u003cbr /\u003e\n\n\u003e 👉 **Start the project** Using HTTPS\n\n```bash\n$ flask run --cert=adhoc\n$\n$ # Access the app: HTTPS://127.0.0.1:5000/\n```\n\n**Important:** The `--cert=adhoc` will force the https protocol\n\n\u003cbr /\u003e\n\n## ✨ Account Details\n\nOnce the user is authenticated, all available information can be accessed via `/ping` route:\n\n\u003e Github sample (truncated): `https://localhost:5000/ping`\n\n```json\n{\n  \"avatar_url\": \"https://avatars.githubusercontent.com/u/51070104?v=4\",\n  \"bio\": \"App Generator and Boilerplate Code.\",\n  \"blog\": \"https://appseed.us/app-generator\",\n  \"company\": \"AppSeed\",\n  \"created_at\": \"2019-05-27T04:55:15Z\",\n  \"followers\": 777,\n  \"public_repos\": 495,\n  \"url\": \"https://api.github.com/users/app-generator\"\n}\n```\n\n\u003cbr /\u003e\n\n## ✨ Sample SShots\n\n\u003e Successfull `Github` Login\n\n![Successfull Github Login](https://user-images.githubusercontent.com/51070104/151698288-9693f769-10a8-4df6-9aa6-8ba817aceada.jpg)\n\n\u003cbr /\u003e\n\n\u003e Successfull `TWitter` Login\n\n![Successfull Twitter Login](https://user-images.githubusercontent.com/51070104/151698313-700023e4-99ea-4ef4-b4bc-d4083ec63ab0.jpg)\n\n\u003cbr /\u003e\n\n\u003e `Github` account information\n\n![Github account info - JSON format.](https://user-images.githubusercontent.com/51070104/151698331-a1ce35b6-1465-4da4-ba03-f227391b5cc8.jpg)\n\n\u003cbr /\u003e\n\n## ✨ Credits\n\n- Originally coded by [TestDriven.IO](https://github.com/testdrivenio/flask-social-auth)\n- [Flask-Dance](https://flask-dance.readthedocs.io/en/latest/) - The library that implements the hard work\n\n\u003cbr /\u003e\n\n---\n\n[Flask Social Login (Twitter \u0026 Github)](https://blog.appseed.us/flask-social-authentication-github-twitter/) - Free sample provided by **AppSeed [App Generator](https://appseed.us/app-generator)**.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapp-generator%2Fsample-flask-auth-social","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapp-generator%2Fsample-flask-auth-social","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapp-generator%2Fsample-flask-auth-social/lists"}