API client for the Identisure REST API.
Documentation: identisure.github.io/api-client-swift
Supports iOS 15+, macOS 12+, tvOS 15+, watchOS 8+.
Swift 5.9 or later. iOS 15, macOS 12, tvOS 15 or watchOS 8 and later.
- 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
Add to Package.swift:
dependencies: [
.package(url: "https://github.com/identisure/api-client-swift.git", from: "0.1.0")
],
targets: [
.target(name: "MyApp", dependencies: [
.product(name: "IdentisureClient", package: "api-client-swift")
])
]import IdentisureClient
let client = IdentisureClientBuilder(clientId: "client_id", clientSecret: "client_secret")
.environment(.staging)
.build()
let session = try await client.bankIdSe.auth(BankIdSeAuthRequest())
if case .pending(let pending) = session {
print("Session ID: \(pending.id)")
let result = try await client.bankIdSe.waitForAuth(id: pending.id)
switch result {
case .completed(let done):
print("Authenticated: \(done.name) (\(done.ssn))")
case .failed(let failed):
print("Failed: \(failed.error)")
case .pending, .unknown:
break
}
}Verify the X-Signature-SHA256 header against the raw request body before parsing it:
let valid = CallbackSignature.verify(body: rawBody, signature: signatureHeader, secret: "hmac_secret")- Swift 5.9+ (
swift --version)
Test fixtures live in a git submodule. Clone with --recurse-submodules, or run git submodule update --init in an existing clone.
swift build
swift testSet the version in Sources/IdentisureClient/Transport.swift and commit. Then push a tag:
git tag v0.1.0
git push origin v0.1.0The release workflow checks that the tag matches the version, runs CI and creates a GitHub release. SwiftPM resolves versions from the tags.
C#, Dart, Go, TypeScript/JavaScript, Java/Kotlin, PHP, Python, Ruby, Rust