API client for the Identisure REST API.
Documentation: pkg.go.dev/github.com/identisure/api-client-go
Go 1.21 or 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
go get github.com/identisure/api-client-gopackage main
import (
"context"
"fmt"
"time"
identisure "github.com/identisure/api-client-go"
)
func main() {
client := identisure.NewClientBuilder("client_id", "client_secret").
Environment(identisure.Staging).
Build()
ctx := context.Background()
session, err := client.BankIdSe().Auth(ctx, identisure.BankIdSeAuthRequest{})
if err != nil {
panic(err)
}
pending := session.(*identisure.BankIdSePending)
fmt.Println("Session ID:", pending.Id)
pollCtx, cancel := context.WithTimeout(ctx, 5*time.Minute)
defer cancel()
result, err := client.BankIdSe().WaitForAuth(pollCtx, pending.Id, identisure.PollOptions{})
if err != nil {
panic(err)
}
switch r := result.(type) {
case *identisure.BankIdSeCompleted:
fmt.Println("Authenticated:", r.Name, r.Ssn)
case *identisure.BankIdSeFailed:
fmt.Println("Failed:", r.Error)
}
}valid := identisure.VerifyCallbackSignature(rawBody, r.Header.Get("X-Signature-SHA256"), hmacSecret)Test fixtures live in a submodule. Clone with --recurse-submodules, or run
git submodule update --init in an existing clone.
go build ./...go test ./...go vet ./...Set the version in client.go and document.go 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, fetches the version through the Go module proxy and creates a GitHub release.
C#, Dart, TypeScript/JavaScript, Java/Kotlin, PHP, Python, Ruby, Rust, Swift