duo_go - Duo 2FA for Go web applications: https://duo.com/docs/duoweb
$ go get github.com/mschwager/duo_go
Here's a short snippet of code demonstrating the library:
package main
import (
"fmt"
"github.com/mschwager/duo_go"
)
func main() {
duo_configuration := &duo_go.Web{
Ikey: "<ikey-here>",
Skey: "<skey-here>",
Akey: "<akey-here>",
}
sig_request, _ := duo_go.SignRequest(duo_configuration, "example_username")
fmt.Println("Signature request: " + sig_request)
}
$ go run example.go
Signature request: TX|ZXh...|5ce...:APP|ZXh...|fc2...
For a more complete example, checkout the demo code.
Configure your ikey
, skey
, akey
, and host
, in duo_go_demo.go
.
Then run the following command:
$ go run duo_go_demo/duo_go_demo.go
$ go test