fastid

FastID authentication platform, high security, lightning fast, easy-to-use, customizable

https://github.com/everysoftware/fastid

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.5%) to scientific vocabulary

Keywords

authentication fastapi google jwt keycloak oauth2 oidc python security sqlalchemy sso telegram yandex
Last synced: 6 months ago · JSON representation ·

Repository

FastID authentication platform, high security, lightning fast, easy-to-use, customizable

Basic Info
Statistics
  • Stars: 46
  • Watchers: 1
  • Forks: 1
  • Open Issues: 0
  • Releases: 0
Topics
authentication fastapi google jwt keycloak oauth2 oidc python security sqlalchemy sso telegram yandex
Created over 1 year ago · Last pushed 9 months ago
Metadata Files
Readme Funding License Code of conduct Citation Codeowners Security

README.md

FastID

FastID authentication platform, high security, lightning fast, easy-to-use, customizable.

Test Coverage CodeQL Bandit License


Live Demo: https://fastid.croce.ru

Documentation: https://everysoftware.github.io/fastid

Source Code: https://github.com/everysoftware/fastid


Features

  • Secure: Reliable authentication without exposing user credentials to the clients (thanks to OAuth 2.0 and OpenID Connect).
  • Fast: Powered by FastAPI (one of the fastest Python web frameworks available) and SQLAlchemy.
  • Easy-to-use: Comes with an admin dashboard to manage users and applications. Built-in user profile pages for account management.
  • Quickly start: Supports sign up with Google, Yandex, etc. Advanced integration with Telegram.
  • In touch with users: Greets users after registration and verifies their actions via OTP.
  • Customizable: Changes the appearance with custom templates for pages and email messages. Functionality can be extended with plugins.
  • Observable: Monitor the platform's performance with 3 pills of observability: logging, metrics and tracing complied. Fully compatible with OpenTelemetry.

Installation

Clone the repository:

bash git clone https://github.com/everysoftware/fastid

Generate RSA keys:

bash make certs

Create a .env file based on .env.example and run the server:

bash make up

FastID is available at http://localhost:8012:

Sign In Profile Connections

Admin panel is available at: http://localhost:8012/admin:

Admin Login Admin Users

To set up observability, you can use this preset.

Enjoy! 🚀

Get Started

To start using FastID, you need to create an application in the admin panel. This will allow you to use FastID for authentication in your application.

Create app

Once you have created an application, you can use the standard OAuth 2.0 flow to authenticate users. FastID supports the authorization code flow, which is the most secure and recommended way to authenticate users.

Here is an example of how to use FastID for authentication in a Python application using the FastAPI framework and the httpx library.

```python from typing import Any from urllib.parse import urlencode

import httpx from fastapi import FastAPI, Request from fastapi.responses import RedirectResponse

FASTIDURL = "http://localhost:8012" FASTIDCLIENTID = ... FASTIDCLIENT_SECRET = ...

app = FastAPI()

@app.get("/login") def login(request: Request) -> Any: params = { "responsetype": "code", "clientid": FASTIDCLIENTID, "redirecturi": request.urlfor("callback"), "scope": "openid", } url = f"{FASTID_URL}/authorize?{urlencode(params)}" return RedirectResponse(url=url)

@app.get("/callback") def callback(code: str) -> Any: response = httpx.post( f"{FASTIDURL}/api/v1/token", headers={"Content-Type": "application/x-www-form-urlencoded"}, data={ "granttype": "authorizationcode", "clientid": FASTIDCLIENTID, "clientsecret": FASTIDCLIENTSECRET, "code": code, }, ) token = response.json()["accesstoken"] response = httpx.get( f"{FASTID_URL}/api/v1/userinfo", headers={"Authorization": f"Bearer {token}"}, ) return response.json() ```

In this example, we define two routes:

  1. /login: Redirects the user to the FastID authorization page.
  2. /callback: Handles the callback from FastID after the user has logged in. It exchanges the authorization code for an access token and retrieves the user's information.

Run the FastAPI application:

bash fastapi dev examples/httpx.py

Visit http://localhost:8000/login to start the authentication process. You will be redirected to the FastID login page, where you can log in with your credentials or use a third-party provider.

Login

After logging in, you will be redirected to the /callback route, where you can access the user's information.

Test Response

Made with ❤️

Owner

  • Name: Ivan Stasevich
  • Login: everysoftware
  • Kind: user
  • Location: Nizhniy Novgorod, Russia

Python developer from Russia

Citation (CITATION.cff)

# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: FastID
message: >-
  If you use this software, please cite it using the
  metadata from this file.
type: software
authors:
  - given-names: Ivan
    family-names: Stasevich
    email: pravitel2015ify@gmail.com
repository-code: 'https://github.com/everysoftware/fastid'
url: 'https://everysoftware.github.io/fastid/'
abstract: >-
  FastID authentication platform, high security, lightning
  fast, easy-to-use, customizable
keywords:
  - fastid
  - oauth2
  - sso
  - keycloak
  - fastapi
license: MIT

GitHub Events

Total
  • Watch event: 42
  • Delete event: 11
  • Push event: 105
  • Pull request event: 23
  • Create event: 9
Last Year
  • Watch event: 42
  • Delete event: 11
  • Push event: 105
  • Pull request event: 23
  • Create event: 9

Committers

Last synced: about 1 year ago

All Time
  • Total Commits: 114
  • Total Committers: 1
  • Avg Commits per committer: 114.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 114
  • Committers: 1
  • Avg Commits per committer: 114.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
everysoftware p****y@g****m 114

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 0
  • Total pull requests: 30
  • Average time to close issues: N/A
  • Average time to close pull requests: 1 day
  • Total issue authors: 0
  • Total pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 27
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 30
  • Average time to close issues: N/A
  • Average time to close pull requests: 1 day
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 27
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
  • everysoftware (35)
Top Labels
Issue Labels
Pull Request Labels

Dependencies

docker-compose-dev.yml docker
poetry.lock pypi
  • alembic 1.13.1
  • annotated-types 0.7.0
  • anyio 4.4.0
  • asyncpg 0.29.0
  • certifi 2024.2.2
  • cfgv 3.4.0
  • click 8.1.7
  • colorama 0.4.6
  • distlib 0.3.8
  • dnspython 2.6.1
  • email-validator 2.1.1
  • fastapi 0.111.0
  • fastapi-cli 0.0.4
  • filelock 3.14.0
  • greenlet 3.0.3
  • gunicorn 22.0.0
  • h11 0.14.0
  • httpcore 1.0.5
  • httptools 0.6.1
  • httpx 0.27.0
  • identify 2.5.36
  • idna 3.7
  • iniconfig 2.0.0
  • itsdangerous 2.2.0
  • jinja2 3.1.4
  • mako 1.3.5
  • markdown-it-py 3.0.0
  • markupsafe 2.1.5
  • mdurl 0.1.2
  • mypy 1.10.0
  • mypy-extensions 1.0.0
  • nodeenv 1.9.0
  • orjson 3.10.3
  • packaging 24.0
  • platformdirs 4.2.2
  • pluggy 1.5.0
  • pre-commit 3.7.1
  • psycopg2 2.9.9
  • pydantic 2.7.2
  • pydantic-core 2.18.3
  • pydantic-extra-types 2.7.0
  • pydantic-settings 2.2.1
  • pygments 2.18.0
  • pytest 8.2.1
  • pytest-asyncio 0.23.7
  • pytest-order 1.2.1
  • python-dotenv 1.0.1
  • python-multipart 0.0.9
  • pyyaml 6.0.1
  • rich 13.7.1
  • ruff 0.4.6
  • shellingham 1.5.4
  • sniffio 1.3.1
  • sqlalchemy 2.0.30
  • sqlalchemy-utils 0.41.2
  • starlette 0.37.2
  • typer 0.12.3
  • typing-extensions 4.12.0
  • ujson 5.10.0
  • uvicorn 0.30.0
  • uvloop 0.19.0
  • virtualenv 20.26.2
  • watchfiles 0.22.0
  • websockets 12.0
pyproject.toml pypi
  • mypy ^1.10.0 develop
  • pre-commit ^3.7.0 develop
  • psycopg2 ^2.9.9 develop
  • pytest ^8.2.0 develop
  • pytest-asyncio ^0.23.6 develop
  • pytest-order ^1.2.1 develop
  • ruff ^0.4.3 develop
  • sqlalchemy-utils ^0.41.2 develop
  • alembic ^1.13.1
  • asyncpg ^0.29.0
  • fastapi ^0.111.0
  • gunicorn ^22.0.0
  • python ^3.12
  • sqlalchemy ^2.0.30
docker-compose.yml docker
  • postgres 16-alpine