Help us shape the future of Go! Take the 2026 Go Developer Survey

identisure

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2026 License: MIT Imports: 13 Imported by: 0

README

Identisure Go Client

pkg.go.dev MIT license

API client for the Identisure REST API.

Documentation: pkg.go.dev/github.com/identisure/api-client-go

Requirements

Go 1.21 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

go get github.com/identisure/api-client-go

Usage

package 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)
    }
}
Verifying callbacks
valid := identisure.VerifyCallbackSignature(rawBody, r.Header.Get("X-Signature-SHA256"), hmacSecret)

Development

Test fixtures live in a submodule. Clone with --recurse-submodules, or run git submodule update --init in an existing clone.

Prerequisites
Build
go build ./...
Test
go test ./...
Vet
go vet ./...
Release

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.0

The release workflow checks that the tag matches the version, runs CI, fetches the version through the Go module proxy and creates a GitHub release.

Other languages

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VerifyCallbackSignature

func VerifyCallbackSignature(body []byte, signature, secret string) bool

VerifyCallbackSignature verifies the X-Signature-SHA256 header of a callback request. body must be the raw request body as received; verify before parsing and never re-serialize. It returns false for a missing, malformed or mismatching signature.

Types

type AgeVerificationCompleted

type AgeVerificationCompleted struct {
	Id          string `json:"id"`
	AgeVerified bool   `json:"ageVerified"`
}

type AgeVerificationFailed

type AgeVerificationFailed struct {
	Id    string `json:"id"`
	Error string `json:"error"`
}

type AgeVerificationPending

type AgeVerificationPending struct {
	Id     string  `json:"id"`
	Url    *string `json:"url"`
	MinAge *int    `json:"minAge"`
	MaxAge *int    `json:"maxAge"`
}

type AgeVerificationRequest

type AgeVerificationRequest struct {
	MinAge      *int    `json:"minAge,omitempty"`
	MaxAge      *int    `json:"maxAge,omitempty"`
	RefId       *string `json:"refId,omitempty"`
	CallbackUrl *string `json:"callbackUrl,omitempty"`
	RedirectUrl *string `json:"redirectUrl,omitempty"`
}

type AgeVerificationStatus

type AgeVerificationStatus interface {
	// contains filtered or unexported methods
}

type BankIdNoAuthRequest

type BankIdNoAuthRequest struct {
	RedirectUrl    *string `json:"redirectUrl,omitempty"`
	RequestSsn     *bool   `json:"requestSsn,omitempty"`
	RequestPhone   *bool   `json:"requestPhone,omitempty"`
	RequestEmail   *bool   `json:"requestEmail,omitempty"`
	RequestAddress *bool   `json:"requestAddress,omitempty"`
	RefId          *string `json:"refId,omitempty"`
	AppCallbackUri *string `json:"appCallbackUri,omitempty"`
}

type BankIdNoBackchannelAuthRequest

type BankIdNoBackchannelAuthRequest struct {
	Ssn         string  `json:"ssn"`
	CallbackUrl *string `json:"callbackUrl,omitempty"`
	RefId       *string `json:"refId,omitempty"`
}

type BankIdNoCompleted

type BankIdNoCompleted struct {
	Id              string                   `json:"id"`
	RefId           *string                  `json:"refId"`
	Ssn             *string                  `json:"ssn"`
	Name            string                   `json:"name"`
	GivenName       string                   `json:"givenName"`
	Surname         string                   `json:"surname"`
	Phone           *string                  `json:"phone"`
	Email           *string                  `json:"email"`
	Address         *string                  `json:"address"`
	BirthDate       *string                  `json:"birthDate"`
	Pid             *string                  `json:"pid"`
	BankId          *string                  `json:"bankId"`
	SignResult      *BankIdNoSignResult      `json:"signResult"`
	SignedDocuments []BankIdNoSignedDocument `json:"signedDocuments"`
	AuthenticatedAt *string                  `json:"authenticatedAt"`
	SignedAt        *string                  `json:"signedAt"`
}

type BankIdNoEndpoint

type BankIdNoEndpoint struct {
	// contains filtered or unexported fields
}

func (*BankIdNoEndpoint) AgeVerification

func (*BankIdNoEndpoint) AgeVerificationStatus

func (e *BankIdNoEndpoint) AgeVerificationStatus(ctx context.Context, id string) (AgeVerificationStatus, error)

func (*BankIdNoEndpoint) Auth

func (*BankIdNoEndpoint) AuthStatus

func (e *BankIdNoEndpoint) AuthStatus(ctx context.Context, id string) (BankIdNoStatus, error)

func (*BankIdNoEndpoint) BackchannelAuth

func (*BankIdNoEndpoint) CancelAgeVerification

func (e *BankIdNoEndpoint) CancelAgeVerification(ctx context.Context, id string) error

func (*BankIdNoEndpoint) CancelAuth

func (e *BankIdNoEndpoint) CancelAuth(ctx context.Context, id string) error

func (*BankIdNoEndpoint) CancelSign

func (e *BankIdNoEndpoint) CancelSign(ctx context.Context, id string) error

func (*BankIdNoEndpoint) Sign

func (*BankIdNoEndpoint) SignStatus

func (e *BankIdNoEndpoint) SignStatus(ctx context.Context, id string) (BankIdNoStatus, error)

func (*BankIdNoEndpoint) WaitForAgeVerification

func (e *BankIdNoEndpoint) WaitForAgeVerification(ctx context.Context, id string, opts PollOptions) (AgeVerificationStatus, error)

func (*BankIdNoEndpoint) WaitForAuth

func (e *BankIdNoEndpoint) WaitForAuth(ctx context.Context, id string, opts PollOptions) (BankIdNoStatus, error)

func (*BankIdNoEndpoint) WaitForSign

func (e *BankIdNoEndpoint) WaitForSign(ctx context.Context, id string, opts PollOptions) (BankIdNoStatus, error)

type BankIdNoFailed

type BankIdNoFailed struct {
	Id    string  `json:"id"`
	RefId *string `json:"refId"`
	Error string  `json:"error"`
}

type BankIdNoPending

type BankIdNoPending struct {
	Id             string  `json:"id"`
	RefId          *string `json:"refId"`
	Url            *string `json:"url"`
	BindingMessage *string `json:"bindingMessage"`
}

type BankIdNoSignRequest

type BankIdNoSignRequest struct {
	RedirectUrl *string  `json:"redirectUrl,omitempty"`
	Text        *string  `json:"text,omitempty"`
	Documents   []string `json:"documents,omitempty"`
	RefId       *string  `json:"refId,omitempty"`
}

type BankIdNoSignResult

type BankIdNoSignResult struct {
	EndUser  string `json:"endUser"`
	Merchant string `json:"merchant"`
	Hash     string `json:"hash"`
}

type BankIdNoSignedDocument

type BankIdNoSignedDocument struct {
	Id   string `json:"id"`
	Hash string `json:"hash"`
}

type BankIdNoStatus

type BankIdNoStatus interface {
	// contains filtered or unexported methods
}

type BankIdSeAuthRequest

type BankIdSeAuthRequest struct {
	Ssn            *string `json:"ssn,omitempty"`
	IpAddress      *string `json:"ipAddress,omitempty"`
	CallbackUrl    *string `json:"callbackUrl,omitempty"`
	PinRequired    *bool   `json:"pinRequired,omitempty"`
	Intent         *string `json:"intent,omitempty"`
	OrgNumber      *string `json:"orgNumber,omitempty"`
	RequestAddress *bool   `json:"requestAddress,omitempty"`
	RefId          *string `json:"refId,omitempty"`
}

type BankIdSeCompleted

type BankIdSeCompleted struct {
	Id                   string          `json:"id"`
	RefId                *string         `json:"refId"`
	Ssn                  string          `json:"ssn"`
	Name                 string          `json:"name"`
	GivenName            string          `json:"givenName"`
	Surname              string          `json:"surname"`
	CertStartDate        *string         `json:"certStartDate"`
	OcspResponse         string          `json:"ocspResponse"`
	Risk                 *string         `json:"risk"`
	Device               *BankIdSeDevice `json:"device"`
	StepUp               *BankIdSeStepUp `json:"stepUp"`
	Address              *string         `json:"address"`
	CompanySignatoryText *string         `json:"companySignatoryText"`
	AuthenticatedAt      *string         `json:"authenticatedAt"`
	SignedAt             *string         `json:"signedAt"`
}

type BankIdSeDevice

type BankIdSeDevice struct {
	IpAddress *string `json:"ipAddress"`
	Uhi       *string `json:"uhi"`
}

type BankIdSeEndpoint

type BankIdSeEndpoint struct {
	// contains filtered or unexported fields
}

func (*BankIdSeEndpoint) AgeVerification

func (*BankIdSeEndpoint) AgeVerificationStatus

func (e *BankIdSeEndpoint) AgeVerificationStatus(ctx context.Context, id string) (AgeVerificationStatus, error)

func (*BankIdSeEndpoint) Auth

func (*BankIdSeEndpoint) AuthStatus

func (e *BankIdSeEndpoint) AuthStatus(ctx context.Context, id string) (BankIdSeStatus, error)

func (*BankIdSeEndpoint) CancelAgeVerification

func (e *BankIdSeEndpoint) CancelAgeVerification(ctx context.Context, id string) error

func (*BankIdSeEndpoint) CancelAuth

func (e *BankIdSeEndpoint) CancelAuth(ctx context.Context, id string) error

func (*BankIdSeEndpoint) CancelSign

func (e *BankIdSeEndpoint) CancelSign(ctx context.Context, id string) error

func (*BankIdSeEndpoint) PhoneAuth

func (*BankIdSeEndpoint) PhoneSign

func (*BankIdSeEndpoint) Sign

func (*BankIdSeEndpoint) SignStatus

func (e *BankIdSeEndpoint) SignStatus(ctx context.Context, id string) (BankIdSeStatus, error)

func (*BankIdSeEndpoint) Verify

func (*BankIdSeEndpoint) WaitForAgeVerification

func (e *BankIdSeEndpoint) WaitForAgeVerification(ctx context.Context, id string, opts PollOptions) (AgeVerificationStatus, error)

func (*BankIdSeEndpoint) WaitForAuth

func (e *BankIdSeEndpoint) WaitForAuth(ctx context.Context, id string, opts PollOptions) (BankIdSeStatus, error)

func (*BankIdSeEndpoint) WaitForSign

func (e *BankIdSeEndpoint) WaitForSign(ctx context.Context, id string, opts PollOptions) (BankIdSeStatus, error)

type BankIdSeFailed

type BankIdSeFailed struct {
	Id    string  `json:"id"`
	RefId *string `json:"refId"`
	Error string  `json:"error"`
}

type BankIdSePending

type BankIdSePending struct {
	Id             string  `json:"id"`
	RefId          *string `json:"refId"`
	AutoStartToken *string `json:"autoStartToken"`
	QrStartToken   *string `json:"qrStartToken"`
	QrStartSecret  *string `json:"qrStartSecret"`
	HintCode       *string `json:"hintCode"`
}

type BankIdSePendingPhone

type BankIdSePendingPhone struct {
	Id       string  `json:"id"`
	RefId    *string `json:"refId"`
	HintCode *string `json:"hintCode"`
}

type BankIdSePhoneAuthRequest

type BankIdSePhoneAuthRequest struct {
	Ssn            string  `json:"ssn"`
	CallInitiator  string  `json:"callInitiator"`
	CallbackUrl    *string `json:"callbackUrl,omitempty"`
	PinRequired    *bool   `json:"pinRequired,omitempty"`
	Intent         *string `json:"intent,omitempty"`
	OrgNumber      *string `json:"orgNumber,omitempty"`
	RequestAddress *bool   `json:"requestAddress,omitempty"`
	RefId          *string `json:"refId,omitempty"`
}

type BankIdSePhoneSignRequest

type BankIdSePhoneSignRequest struct {
	Ssn            string  `json:"ssn"`
	CallInitiator  string  `json:"callInitiator"`
	Text           string  `json:"text"`
	CallbackUrl    *string `json:"callbackUrl,omitempty"`
	PinRequired    *bool   `json:"pinRequired,omitempty"`
	Digest         *string `json:"digest,omitempty"`
	OrgNumber      *string `json:"orgNumber,omitempty"`
	RequestAddress *bool   `json:"requestAddress,omitempty"`
	RefId          *string `json:"refId,omitempty"`
}

type BankIdSePhoneStatus

type BankIdSePhoneStatus interface {
	// contains filtered or unexported methods
}

type BankIdSeSignRequest

type BankIdSeSignRequest struct {
	Text           string  `json:"text"`
	Ssn            *string `json:"ssn,omitempty"`
	IpAddress      *string `json:"ipAddress,omitempty"`
	CallbackUrl    *string `json:"callbackUrl,omitempty"`
	PinRequired    *bool   `json:"pinRequired,omitempty"`
	Digest         *string `json:"digest,omitempty"`
	OrgNumber      *string `json:"orgNumber,omitempty"`
	RequestAddress *bool   `json:"requestAddress,omitempty"`
	RefId          *string `json:"refId,omitempty"`
}

type BankIdSeStatus

type BankIdSeStatus interface {
	// contains filtered or unexported methods
}

type BankIdSeStepUp

type BankIdSeStepUp struct {
	Mrtd *bool `json:"mrtd"`
	Face *bool `json:"face"`
}

type BankIdSeVerifyRequest

type BankIdSeVerifyRequest struct {
	QrCode string `json:"qrCode"`
}

type BankIdSeVerifyResponse

type BankIdSeVerifyResponse struct {
	Ssn        string  `json:"ssn"`
	Name       string  `json:"name"`
	GivenName  string  `json:"givenName"`
	Surname    string  `json:"surname"`
	Age        *int    `json:"age"`
	VerifiedAt *string `json:"verifiedAt"`
}

type DocumentEndpoint

type DocumentEndpoint struct {
	// contains filtered or unexported fields
}

func (*DocumentEndpoint) Download

func (e *DocumentEndpoint) Download(ctx context.Context, id string) ([]byte, error)

func (*DocumentEndpoint) Upload

func (e *DocumentEndpoint) Upload(ctx context.Context, data []byte, filename string, mimeType string) (*DocumentUploadResponse, error)

type DocumentUploadResponse

type DocumentUploadResponse struct {
	Id   string `json:"id"`
	Hash string `json:"hash"`
}

type Environment

type Environment int
const (
	Production Environment = iota
	Staging
)

type FrejaAuthRequest

type FrejaAuthRequest struct {
	Ssn                  *string `json:"ssn,omitempty"`
	CallbackUrl          *string `json:"callbackUrl,omitempty"`
	MinRegistrationLevel *string `json:"minRegistrationLevel,omitempty"`
	OrgNumber            *string `json:"orgNumber,omitempty"`
	RequestAddress       *bool   `json:"requestAddress,omitempty"`
	RefId                *string `json:"refId,omitempty"`
}

type FrejaBackchannelAuthRequest

type FrejaBackchannelAuthRequest struct {
	Ssn                  string  `json:"ssn"`
	Country              string  `json:"country"`
	CallbackUrl          *string `json:"callbackUrl,omitempty"`
	MinRegistrationLevel *string `json:"minRegistrationLevel,omitempty"`
	OrgNumber            *string `json:"orgNumber,omitempty"`
	RequestAddress       *bool   `json:"requestAddress,omitempty"`
	RefId                *string `json:"refId,omitempty"`
}

type FrejaBackchannelSignRequest

type FrejaBackchannelSignRequest struct {
	Ssn                  string  `json:"ssn"`
	Country              string  `json:"country"`
	Text                 string  `json:"text"`
	CallbackUrl          *string `json:"callbackUrl,omitempty"`
	MinRegistrationLevel *string `json:"minRegistrationLevel,omitempty"`
	OrgNumber            *string `json:"orgNumber,omitempty"`
	RequestAddress       *bool   `json:"requestAddress,omitempty"`
	RefId                *string `json:"refId,omitempty"`
}

type FrejaCompleted

type FrejaCompleted struct {
	Id                   string  `json:"id"`
	RefId                *string `json:"refId"`
	Ssn                  string  `json:"ssn"`
	Country              string  `json:"country"`
	Name                 string  `json:"name"`
	GivenName            string  `json:"givenName"`
	Surname              string  `json:"surname"`
	Address              *string `json:"address"`
	CompanySignatoryText *string `json:"companySignatoryText"`
	AuthenticatedAt      *string `json:"authenticatedAt"`
	SignedAt             *string `json:"signedAt"`
}

type FrejaEndpoint

type FrejaEndpoint struct {
	// contains filtered or unexported fields
}

func (*FrejaEndpoint) AgeVerification

func (*FrejaEndpoint) AgeVerificationStatus

func (e *FrejaEndpoint) AgeVerificationStatus(ctx context.Context, id string) (AgeVerificationStatus, error)

func (*FrejaEndpoint) Auth

func (*FrejaEndpoint) AuthStatus

func (e *FrejaEndpoint) AuthStatus(ctx context.Context, id string) (FrejaStatus, error)

func (*FrejaEndpoint) BackchannelAuth

func (*FrejaEndpoint) BackchannelSign

func (*FrejaEndpoint) CancelAgeVerification

func (e *FrejaEndpoint) CancelAgeVerification(ctx context.Context, id string) error

func (*FrejaEndpoint) CancelAuth

func (e *FrejaEndpoint) CancelAuth(ctx context.Context, id string) error

func (*FrejaEndpoint) CancelSign

func (e *FrejaEndpoint) CancelSign(ctx context.Context, id string) error

func (*FrejaEndpoint) Sign

func (*FrejaEndpoint) SignStatus

func (e *FrejaEndpoint) SignStatus(ctx context.Context, id string) (FrejaStatus, error)

func (*FrejaEndpoint) WaitForAgeVerification

func (e *FrejaEndpoint) WaitForAgeVerification(ctx context.Context, id string, opts PollOptions) (AgeVerificationStatus, error)

func (*FrejaEndpoint) WaitForAuth

func (e *FrejaEndpoint) WaitForAuth(ctx context.Context, id string, opts PollOptions) (FrejaStatus, error)

func (*FrejaEndpoint) WaitForSign

func (e *FrejaEndpoint) WaitForSign(ctx context.Context, id string, opts PollOptions) (FrejaStatus, error)

type FrejaFailed

type FrejaFailed struct {
	Id    string  `json:"id"`
	RefId *string `json:"refId"`
	Error string  `json:"error"`
}

type FrejaPending

type FrejaPending struct {
	Id             string  `json:"id"`
	RefId          *string `json:"refId"`
	AutoStartToken string  `json:"autoStartToken"`
	QrData         string  `json:"qrData"`
}

type FrejaSignRequest

type FrejaSignRequest struct {
	Text                 string  `json:"text"`
	Ssn                  *string `json:"ssn,omitempty"`
	CallbackUrl          *string `json:"callbackUrl,omitempty"`
	MinRegistrationLevel *string `json:"minRegistrationLevel,omitempty"`
	OrgNumber            *string `json:"orgNumber,omitempty"`
	RequestAddress       *bool   `json:"requestAddress,omitempty"`
	RefId                *string `json:"refId,omitempty"`
}

type FrejaStatus

type FrejaStatus interface {
	// contains filtered or unexported methods
}

type FtnAuthRequest

type FtnAuthRequest struct {
	RedirectUrl    *string `json:"redirectUrl,omitempty"`
	RequestPhone   *bool   `json:"requestPhone,omitempty"`
	RequestEmail   *bool   `json:"requestEmail,omitempty"`
	RequestAddress *bool   `json:"requestAddress,omitempty"`
	RefId          *string `json:"refId,omitempty"`
}

type FtnCompleted

type FtnCompleted struct {
	Id              string  `json:"id"`
	RefId           *string `json:"refId"`
	Ssn             *string `json:"ssn"`
	Name            string  `json:"name"`
	GivenName       string  `json:"givenName"`
	Surname         string  `json:"surname"`
	Phone           *string `json:"phone"`
	Email           *string `json:"email"`
	Address         *string `json:"address"`
	BirthDate       *string `json:"birthDate"`
	Pid             *string `json:"pid"`
	BankId          *string `json:"bankId"`
	BankName        *string `json:"bankName"`
	AuthenticatedAt *string `json:"authenticatedAt"`
}

type FtnEndpoint

type FtnEndpoint struct {
	// contains filtered or unexported fields
}

func (*FtnEndpoint) AgeVerification

func (*FtnEndpoint) AgeVerificationStatus

func (e *FtnEndpoint) AgeVerificationStatus(ctx context.Context, id string) (AgeVerificationStatus, error)

func (*FtnEndpoint) Auth

func (*FtnEndpoint) AuthStatus

func (e *FtnEndpoint) AuthStatus(ctx context.Context, id string) (FtnStatus, error)

func (*FtnEndpoint) CancelAgeVerification

func (e *FtnEndpoint) CancelAgeVerification(ctx context.Context, id string) error

func (*FtnEndpoint) CancelAuth

func (e *FtnEndpoint) CancelAuth(ctx context.Context, id string) error

func (*FtnEndpoint) WaitForAgeVerification

func (e *FtnEndpoint) WaitForAgeVerification(ctx context.Context, id string, opts PollOptions) (AgeVerificationStatus, error)

func (*FtnEndpoint) WaitForAuth

func (e *FtnEndpoint) WaitForAuth(ctx context.Context, id string, opts PollOptions) (FtnStatus, error)

type FtnFailed

type FtnFailed struct {
	Id    string  `json:"id"`
	RefId *string `json:"refId"`
	Error string  `json:"error"`
}

type FtnPending

type FtnPending struct {
	Id    string  `json:"id"`
	RefId *string `json:"refId"`
	Url   string  `json:"url"`
}

type FtnStatus

type FtnStatus interface {
	// contains filtered or unexported methods
}

type IdentisureClient

type IdentisureClient struct {
	// contains filtered or unexported fields
}

func (*IdentisureClient) BankIdNo

func (c *IdentisureClient) BankIdNo() *BankIdNoEndpoint

func (*IdentisureClient) BankIdSe

func (c *IdentisureClient) BankIdSe() *BankIdSeEndpoint

func (*IdentisureClient) Document

func (c *IdentisureClient) Document() *DocumentEndpoint

func (*IdentisureClient) Freja

func (c *IdentisureClient) Freja() *FrejaEndpoint

func (*IdentisureClient) Ftn

func (c *IdentisureClient) Ftn() *FtnEndpoint

func (*IdentisureClient) MitId

func (c *IdentisureClient) MitId() *MitIdEndpoint

func (*IdentisureClient) Vipps

func (c *IdentisureClient) Vipps() *VippsEndpoint

type IdentisureClientBuilder

type IdentisureClientBuilder struct {
	// contains filtered or unexported fields
}

func NewClientBuilder

func NewClientBuilder(clientID, clientSecret string) *IdentisureClientBuilder

func (*IdentisureClientBuilder) BaseURL

func (*IdentisureClientBuilder) Build

func (*IdentisureClientBuilder) Environment

func (*IdentisureClientBuilder) HTTPClient

func (*IdentisureClientBuilder) Timeout

Timeout sets the timeout for each HTTP request, including reading the response body. It must be positive. Default: 30s.

type IdentisureError

type IdentisureError struct {
	StatusCode int    `json:"-"`
	Message    string `json:"message"`
	// Err is the underlying network or decoding error, if any.
	Err error `json:"-"`
}

IdentisureError is returned on non-2xx responses or network failure.

func (*IdentisureError) Error

func (e *IdentisureError) Error() string

func (*IdentisureError) Unwrap

func (e *IdentisureError) Unwrap() error

type MitIdAuthRequest

type MitIdAuthRequest struct {
	RedirectUrl    *string `json:"redirectUrl,omitempty"`
	ReferenceText  *string `json:"referenceText,omitempty"`
	RequestPhone   *bool   `json:"requestPhone,omitempty"`
	RequestEmail   *bool   `json:"requestEmail,omitempty"`
	RequestAddress *bool   `json:"requestAddress,omitempty"`
	RefId          *string `json:"refId,omitempty"`
}

type MitIdBackchannelAuthRequest

type MitIdBackchannelAuthRequest struct {
	Ssn            string  `json:"ssn"`
	BindingMessage string  `json:"bindingMessage"`
	CallbackUrl    *string `json:"callbackUrl,omitempty"`
	RefId          *string `json:"refId,omitempty"`
}

type MitIdCompleted

type MitIdCompleted struct {
	Id              string           `json:"id"`
	RefId           *string          `json:"refId"`
	Ssn             *string          `json:"ssn"`
	Name            string           `json:"name"`
	GivenName       string           `json:"givenName"`
	Surname         string           `json:"surname"`
	Phone           *string          `json:"phone"`
	Email           *string          `json:"email"`
	Address         *string          `json:"address"`
	BirthDate       *string          `json:"birthDate"`
	Pid             *string          `json:"pid"`
	BankId          *string          `json:"bankId"`
	SignResult      *MitIdSignResult `json:"signResult"`
	AuthenticatedAt *string          `json:"authenticatedAt"`
	SignedAt        *string          `json:"signedAt"`
}

type MitIdEndpoint

type MitIdEndpoint struct {
	// contains filtered or unexported fields
}

func (*MitIdEndpoint) AgeVerification

func (*MitIdEndpoint) AgeVerificationStatus

func (e *MitIdEndpoint) AgeVerificationStatus(ctx context.Context, id string) (AgeVerificationStatus, error)

func (*MitIdEndpoint) Auth

func (*MitIdEndpoint) AuthStatus

func (e *MitIdEndpoint) AuthStatus(ctx context.Context, id string) (MitIdStatus, error)

func (*MitIdEndpoint) BackchannelAuth

func (*MitIdEndpoint) CancelAgeVerification

func (e *MitIdEndpoint) CancelAgeVerification(ctx context.Context, id string) error

func (*MitIdEndpoint) CancelAuth

func (e *MitIdEndpoint) CancelAuth(ctx context.Context, id string) error

func (*MitIdEndpoint) CancelSign

func (e *MitIdEndpoint) CancelSign(ctx context.Context, id string) error

func (*MitIdEndpoint) Sign

func (*MitIdEndpoint) SignStatus

func (e *MitIdEndpoint) SignStatus(ctx context.Context, id string) (MitIdStatus, error)

func (*MitIdEndpoint) WaitForAgeVerification

func (e *MitIdEndpoint) WaitForAgeVerification(ctx context.Context, id string, opts PollOptions) (AgeVerificationStatus, error)

func (*MitIdEndpoint) WaitForAuth

func (e *MitIdEndpoint) WaitForAuth(ctx context.Context, id string, opts PollOptions) (MitIdStatus, error)

func (*MitIdEndpoint) WaitForSign

func (e *MitIdEndpoint) WaitForSign(ctx context.Context, id string, opts PollOptions) (MitIdStatus, error)

type MitIdFailed

type MitIdFailed struct {
	Id    string  `json:"id"`
	RefId *string `json:"refId"`
	Error string  `json:"error"`
}

type MitIdPending

type MitIdPending struct {
	Id             string  `json:"id"`
	RefId          *string `json:"refId"`
	Url            *string `json:"url"`
	BindingMessage *string `json:"bindingMessage"`
}

type MitIdSignRequest

type MitIdSignRequest struct {
	Text        string  `json:"text"`
	RedirectUrl *string `json:"redirectUrl,omitempty"`
	RefId       *string `json:"refId,omitempty"`
}

type MitIdSignResult

type MitIdSignResult struct {
	Checksum string `json:"checksum"`
}

type MitIdStatus

type MitIdStatus interface {
	// contains filtered or unexported methods
}

type PollOptions

type PollOptions struct {
	Interval time.Duration // default: 2s when zero
}

PollOptions configures WaitFor* polling helpers.

type UnknownStatus

type UnknownStatus struct {
	Status string
}

UnknownStatus is returned for a session status this client version does not recognize.

type VippsAuthRequest

type VippsAuthRequest struct {
	RedirectUrl    *string `json:"redirectUrl,omitempty"`
	RequestSsn     *bool   `json:"requestSsn,omitempty"`
	RequestPhone   *bool   `json:"requestPhone,omitempty"`
	RequestEmail   *bool   `json:"requestEmail,omitempty"`
	RequestAddress *bool   `json:"requestAddress,omitempty"`
	RefId          *string `json:"refId,omitempty"`
	AppCallbackUri *string `json:"appCallbackUri,omitempty"`
}

type VippsBackchannelAuthRequest

type VippsBackchannelAuthRequest struct {
	Phone          string  `json:"phone"`
	RequestSsn     *bool   `json:"requestSsn,omitempty"`
	RequestEmail   *bool   `json:"requestEmail,omitempty"`
	RequestAddress *bool   `json:"requestAddress,omitempty"`
	CallbackUrl    *string `json:"callbackUrl,omitempty"`
	RefId          *string `json:"refId,omitempty"`
}

type VippsCompleted

type VippsCompleted struct {
	Id              string  `json:"id"`
	RefId           *string `json:"refId"`
	Ssn             *string `json:"ssn"`
	Name            string  `json:"name"`
	GivenName       string  `json:"givenName"`
	Surname         string  `json:"surname"`
	Phone           *string `json:"phone"`
	Email           *string `json:"email"`
	Address         *string `json:"address"`
	BirthDate       *string `json:"birthDate"`
	Pid             *string `json:"pid"`
	BankId          *string `json:"bankId"`
	AuthenticatedAt *string `json:"authenticatedAt"`
}

type VippsEndpoint

type VippsEndpoint struct {
	// contains filtered or unexported fields
}

func (*VippsEndpoint) Auth

func (*VippsEndpoint) AuthStatus

func (e *VippsEndpoint) AuthStatus(ctx context.Context, id string) (VippsStatus, error)

func (*VippsEndpoint) BackchannelAuth

func (*VippsEndpoint) CancelAuth

func (e *VippsEndpoint) CancelAuth(ctx context.Context, id string) error

func (*VippsEndpoint) WaitForAuth

func (e *VippsEndpoint) WaitForAuth(ctx context.Context, id string, opts PollOptions) (VippsStatus, error)

type VippsFailed

type VippsFailed struct {
	Id    string  `json:"id"`
	RefId *string `json:"refId"`
	Error string  `json:"error"`
}

type VippsPending

type VippsPending struct {
	Id    string  `json:"id"`
	RefId *string `json:"refId"`
	Url   *string `json:"url"`
}

type VippsStatus

type VippsStatus interface {
	// contains filtered or unexported methods
}

type WaitError

type WaitError struct {
	Timeout bool
	Err     error
}

WaitError is returned only by WaitFor* polling helpers.

func (*WaitError) Error

func (e *WaitError) Error() string

func (*WaitError) Unwrap

func (e *WaitError) Unwrap() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL