Skip to main content

A Django app that handles the communication between the IDP and the products for the authorization of users.

Project description

  1. Add “idp_user” to your INSTALLED_APPS setting like this:

    INSTALLED_APPS = [
        ...
        'idp_user',
    ]
  2. Add the settings of the app in settings.py like this:

    APP_ENV = "development"/"staging"/"production"
    
    AUTH_USER_MODEL = 'idp_user.User'
    
    IDP_USER_APP = {
        "APP_IDENTIFIER": "str",
        "ROLES": "path.to.roles_choices",
        "FAUST_APP_PATH": "backend.kafka_consumer.app",
        "OPA_DOMAIN": os.getenv("OPA_DOMAIN"),
        "OPA_VERSION": os.getenv("OPA_VERSION"),
        "IDP_URL": os.getenv("IDP_URL"),
        "USE_REDIS_CACHE": True,
        "INJECT_HEADERS_IN_DEV": True
    }
    
    REST_FRAMEWORK = {
        'DEFAULT_SCHEMA_CLASS': 'drf_spectacular.openapi.AutoSchema' / 'idp_user.schema_extensions.AutoSchemaWithRole',
        'DEFAULT_AUTHENTICATION_CLASSES': (
            'idp_user.auth.AuthenticationBackend',
        ),
        'DEFAULT_PERMISSION_CLASSES': (
            'idp_user.auth.OpaCheckPermission',
        ),
    }
    
    SPECTACULAR_SETTINGS = {
        'DEFAULT_AUTHENTICATION_CLASSES': (
            'idp_user.schema_extensions.BearerTokenScheme',
        ),
        'SERVE_AUTHENTICATION': ()
    }
  3. Run python manage.py migrate to create the models.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_idp_user-0.7.0.tar.gz (13.1 kB view details)

Uploaded Source

File details

Details for the file django_idp_user-0.7.0.tar.gz.

File metadata

  • Download URL: django_idp_user-0.7.0.tar.gz
  • Upload date:
  • Size: 13.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for django_idp_user-0.7.0.tar.gz
Algorithm Hash digest
SHA256 209073a074492317211e586d602a82bbfce2c9f0acf89e36c8cdf114cfde3ce3
MD5 31e3d5cdbb5bf6f8e0ffce66c7230f22
BLAKE2b-256 fd9c050882763ea841fe9988b2363ac3222cdb3b03872eead89d90d5e5750eb5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page