BankID library
A library for providing BankID services as an RP (Relying party).
Supports the latest v6 features.
To learn how to use the library, please refer to the documentation. There are some examples that may be useful that may be useful as well.
Installation
The library can be installed through go get
go get github.com/NicklasWallgren/bankid/v2
Supported versions
We support the two major Go versions, which are 1.20 and 1.21 at the moment.
Features
- Supports all v6.0 features
SDK
// Creates new BankID instance
New(configuration *configuration.Configuration) (*BankID)
// Initiates an authentication order
(b BankID) Authenticate(context context.Context, payload *AuthenticationPayload) (*AuthenticateResponse, error)
// Initiates a phone authentication order
(b BankID) PhoneAuthenticate(context context.Context, payload *PhoneAuthenticationPayload) (*PhoneAuthenticateResponse, error)
// Initiates a sign order
(b BankID) Sign(context context.Context, payload *SignPayload) (*SignResponse, error)
// Initiates a phone sign order
(b BankID) PhoneSign(context context.Context, payload *PhoneSignPayload) (*PhoneSignResponse, error)
// Collects the result of a sign or auth order using the orderRef as reference
(b BankID) Collect(context context.Context, payload *CollectPayload) (*CollectResponse, error)
// Cancels an ongoing sign or auth order
(b BankID) Cancel(context context.Context, payload *CancelPayload) (*CancelResponse, error)
Unit tests
go test -v -race $(go list ./... | grep -v vendor)
Code Guide
We use GitHub Actions to make sure the codebase is consistent (golangci-lint run
) and continuously tested (go test -v -race $(go list ./... | grep -v vendor)
). We try to keep comments at a maximum of 120 characters of length and code at 120.
Contributing
If you find any problems or have suggestions about this library, please submit an issue. Moreover, any pull request, code review and feedback are welcome.
Contributors
License
MIT