OpenG2P FastAPI Auth

Introduction

This is a Python package that provides additional support, particularly Authentication and Authorization, to the OpenG2P FastAPI Common Library. This page describes different concepts within the library and instructions on how to use it.

Technical Concepts

This package/library contains API Authentication and Authorization helpers for Rest API Services that are bootstrapped by the OpenG2P FastAPI Common Library. Details:

Name
Description

Login Provider

  • LoginProvider is an object that helps the user login in the current web app using an external Authorization System.

  • LoginProviders is a database table where different types of login providers can be configured.

    • This module also exposes APIs to query the LoginProviders configured on DB.

  • The type column of LoginProviders can be set to one of the following values.

    • oauth2_auth_code - If the type is set to this, then the LoginProvider is an OIDC Provider, that supports the basic auth_code flow. (With PKCE being optional)

  • The authorization_parameters are the parameters required by this LoginProvider

AuthController

TODO

OauthController

TODO

JwtBearerAuth

TODO

ApiAuthSettings

TODO

Installation

This section describes instructions for installing the package. Primarily intended for developers using this module.

  • Install python3 for your environment.

  • Set up a virtualenv in your project directory. Using:

    python3 -n venv .venv
    source .venv/bin/activate
  • Then Install the common package using pip:

    pip install -e <path-to-cloned-common-repo>/openg2p-fastapi-auth

Usage Guide

This section describes instructions for using the package/library. Primarily intended for developers using this module to build their own projects.

TODO

Configuration

TODO

Source Code

Last updated

Logo

Copyright © 2024 OpenG2P. This work is licensed under Creative Commons Attribution International LicenseCC-BY-4.0 unless otherwise noted.