Metadata-Version: 2.4
Name: mitid_connect
Version: 0.0.1
Summary: Log in through MitID from Python: an unofficial implementation of MitID's browser client, with the MitID app or a code token.
Author: HairingX
License-Expression: MIT
Project-URL: Homepage, https://github.com/HairingX/mitid_connect
Project-URL: Source, https://github.com/HairingX/mitid_connect
Project-URL: Issues, https://github.com/HairingX/mitid_connect/issues
Project-URL: Releases, https://github.com/HairingX/mitid_connect/releases
Keywords: mitid,nemlog-in,login,denmark
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Libraries
Classifier: Typing :: Typed
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: beautifulsoup4>=4.12.0
Requires-Dist: lxml>=5.0.0
Requires-Dist: pycryptodomex>=3.24.1
Requires-Dist: qrcode>=8.2
Requires-Dist: requests>=2.31.0
Dynamic: license-file

# mitid_connect

Log in through [MitID](https://www.mitid.dk) 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.

```python
from mitid_connect import BrowserClient

client = BrowserClient(client_hash, authentication_session_id)
authenticators = client.identify_as_user_and_get_available_authenticators("username")
client.authenticate_with_app()            # approve in the MitID app
code = 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.

It is used by [aula_connect](https://github.com/HairingX/aula_connect) to log in to Aula.

## Origin and licence

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