Skip to main content

mitid_connect

Log in through MitID from Python: an unofficial implementation of MitID's browser client. It authenticates with the MitID app - by QR code or one-time code - or with a code token, and gives back the authorization code that the service being logged in to exchanges for its own tokens.

It is asynchronous, and runs on the aiohttp session the caller gives it - the session of the service's login flow, as MitID's steps share its cookies:

import aiohttp
from mitid_connect import BrowserClient

async with aiohttp.ClientSession() as session:
    client = BrowserClient(session, client_hash, authentication_session_id)
    await client.start()
    authenticators = await client.identify_as_user_and_get_available_authenticators("username")
    await client.authenticate_with_app()  # approve in the MitID app
    code = await client.finalize_authentication_and_get_authorization_code()

client_hash and authentication_session_id come from the service's NemLog-in page; get_authentication_code does all of the above from that page's parameters. While the app login runs, get_current_qr_codes() gives the two QR codes to show in turn, and status_message how far it has come.

mitid_connect.testing.SimulatedMitID is a MitID on a local test server, for tests. It answers an app login, and a code token login with its password, as MitID does, and checks the client's proofs as MitID does. Its users have the app by default; a User gives one a code token, its digits and the password instead. Its Network gives each answer a latency, fixed or drawn from a range, and fails a share of them, for stress tests.

Origin and licence

It carries on MitID-BrowserClient by Hundter, under the MIT licence (LICENSE).

Metadata

Release files for mitid-connect 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mitid-connect 0.1.1
File Size Uploaded Provenance Actions
mitid_connect-0.1.1.tar.gz 33.4 kB With provenance Details for mitid_connect-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mitid-connect 0.1.1
File Interpreter ABI Platform Actions
mitid_connect-0.1.1-py3-none-any.whl Python 3 none any Details for mitid_connect-0.1.1-py3-none-any.whl

Total release size: 52.7 kB

Release files / mitid_connect-0.1.1.tar.gz

Download URL mitid_connect-0.1.1.tar.gz
Size 33.4 kB
Tags Source
SHA-256 checksum
How to use checksums
bae04b901275c8c0a206e4afe5a90230f2440cd940f078b969a91be318918afc
BLAKE2b-256 checksum
How to use checksums
6f489a74a50dc05c532f8d45b48ffdde405604c552076680e0f42a54f23a80df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Release files / mitid_connect-0.1.1-py3-none-any.whl

Download URL mitid_connect-0.1.1-py3-none-any.whl
Size 19.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d27e32731d4876788d422926ba21773cf389aab75276eb5734a9b5158c54468e
BLAKE2b-256 checksum
How to use checksums
f73bea6310fe81c4749f6435fd7f469abac6303025a7502185574b9310a95c4e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Security for mitid-connect 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for mitid_connect-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page