Skip to main content

Common identity providers for use with Aserto client libraries

Project description

Aserto Identity Providers

Common identity providers for use with Aserto client libraries

Installation

Using Pip

pip install aserto-idp

Using Poetry

poetry add aserto-idp

Current Identity Providers

OpenID Connect

from aserto_idp.oidc import identity_provider

Usage

With aserto-authorizer-grpc

from aserto.client import IdentityContext, IdentityType
from aserto_idp.oidc import AccessTokenError, identity_provider

oidc_provider = identity_provider(issuer=OIDC_ISSUER, client_id=OIDC_CLIENT_ID)

try:
    subject = await oidc_provider.subject_from_jwt_auth_header(request.headers["Authorization"])

    identity_context = IdentityContext(
        type=IdentityType.IDENTITY_TYPE_SUB,
        identity=subject,
    )
except AccessTokenError:
    identity_context = IdentityContext(type=IdentityType.IDENTITY_TYPE_NONE)

With aserto

from aserto import Identity
from aserto_idp.oidc import AccessTokenError, IdentityProvider

oidc_provider = identity_provider(issuer=OIDC_ISSUER, client_id=OIDC_CLIENT_ID)

try:
    subject = await oidc_provider.subject_from_jwt_auth_header(request.headers["Authorization"])

    identity = Identity(type="SUBJECT", subject=subject)
except AccessTokenError:
    identity = Identity(type="NONE")

Project details


Download files

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

Source Distribution

aserto-idp-0.3.1.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

aserto_idp-0.3.1-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file aserto-idp-0.3.1.tar.gz.

File metadata

  • Download URL: aserto-idp-0.3.1.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.7.12 Darwin/23.0.0

File hashes

Hashes for aserto-idp-0.3.1.tar.gz
Algorithm Hash digest
SHA256 6240f0cb452ea76a13ba114a314837f014372946d04ed3a3cd82f17807f3c74c
MD5 a84130d949e902ef906de9e3398165ce
BLAKE2b-256 06cd59e1f5672b55602050d2bed1488f860cf9f47f095fd4d0ac47c45af7ac99

See more details on using hashes here.

File details

Details for the file aserto_idp-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: aserto_idp-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.7.12 Darwin/23.0.0

File hashes

Hashes for aserto_idp-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 439fe873aca22f497a4ef7189caafaa9d71ef5606a094f2345544157ae24c0f3
MD5 2187f41c09323577d1feab19f28cae6c
BLAKE2b-256 65c22bd5ec2180a281d9341dbde208db2d2412ba569b0a095b57527277f3115f

See more details on using hashes here.

Supported by

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