Skip to content

A wrapper library for the BankID SOAP api in Golang

Notifications You must be signed in to change notification settings

fouxarn/go-bankid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go BankID

This library makes BankID authentications in Golang a breeze.

Requirements

  • For Production usage, a pfx certificate issued by a certified Bank.

Quickstart

go get github.com/fouxarn/go-bankid

Example

package main

import (
  "bufio"
  "fmt"
  "os"

  bankid "github.com/fouxarn/go-bankid"
)

func main() {
  client, _ := bankid.NewTestClient()
  
  u := &bankid.EndUserInfo{
    UserInfoType: "IP_ADDR",
    Value:        "192.168.0.1",
  }
  authResp, _ := s.Authenticate("190101010593", u)
  
  reader := bufio.NewScanner(os.Stdin)
  fmt.Println("Please open your bankid-app and verify authentication request")
  scanner.Scan()
  
  collResp, _ := s.Collect(authResp.OrderRef)
  
  if collResp.Status == bankid.StatusComplete {
    fmt.Printf("%v is now authenticated!\n", collResp.UserInfo.GivenName)
  } else {
    fmt.Printf("Failed authentication!\n")
  }
}

About

A wrapper library for the BankID SOAP api in Golang

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages