Skip to content

About

Identisure API client for Python

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Identisure Python Client

PyPI Downloads Documentation MIT license

API client for the Identisure REST API. Supports both synchronous and async usage via httpx and Pydantic models.

Documentation: identisure.github.io/api-client-py

Requirements

Python 3.10 or later.

Supported providers

  • BankID SE: auth, sign, phone auth and sign, QR verify, age verification
  • BankID NO: auth, backchannel auth, sign, age verification
  • Freja eID: auth, backchannel auth, sign, backchannel sign, age verification
  • MitID: auth, backchannel auth, sign, age verification
  • FTN (Finnish Trust Network): auth, age verification
  • Vipps MobilePay: auth, backchannel auth
  • Documents: upload and download documents for signing

Installation

pip install identisure-client

Usage

Synchronous

from identisure_client import IdentisureClientBuilder, BankIdSeAuthRequest, PollOptions

with IdentisureClientBuilder("client_id", "client_secret").environment("staging").build() as client:
    session = client.bankid_se().auth(BankIdSeAuthRequest())
    result = client.bankid_se().wait_for_auth(session.id, PollOptions())

print(result)

Async

import asyncio
from identisure_client import IdentisureClientBuilder, BankIdSeAuthRequest, PollOptions


async def main():
    async with (
        IdentisureClientBuilder("client_id", "client_secret")
        .environment("staging")
        .build_async() as client
    ):
        session = await client.bankid_se().auth(BankIdSeAuthRequest())
        result = await client.bankid_se().wait_for_auth(session.id, PollOptions())

    print(result)


asyncio.run(main())

Verifying callbacks

Pass the raw request body exactly as received, before parsing it.

from identisure_client import verify_callback_signature

valid = verify_callback_signature(raw_body, headers["X-Signature-SHA256"], hmac_secret)

Development

Prerequisites

Clone

The test fixtures live in a git submodule, so clone with --recurse-submodules (or run git submodule update --init in an existing clone).

git clone --recurse-submodules https://github.com/identisure/api-client-py.git

Install dependencies

uv sync --extra dev

Build, test and lint

just build
just test
just check

Release

Set the version in pyproject.toml and identisure_client/_client.py and commit. Then push a tag:

git tag v0.1.0
git push origin v0.1.0

The release workflow checks that the tag matches the version, runs CI, publishes to PyPI and creates a GitHub release.

Other languages

C#, Dart, Go, TypeScript/JavaScript, Java/Kotlin, PHP, Ruby, Rust, Swift

About

Identisure API client for Python

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages