https://github.com/mschwager/duo_go
An implementation of the Duo Security Web SDK in Go/Golang.
https://github.com/mschwager/duo_go
2fa demo duo go golang websdk
Last synced: 8 months ago
JSON representation
An implementation of the Duo Security Web SDK in Go/Golang.
- Host: GitHub
- URL: https://github.com/mschwager/duo_go
- Owner: mschwager
- License: apache-2.0
- Created: 2016-11-12T21:53:06.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2020-05-01T15:34:57.000Z (about 6 years ago)
- Last Synced: 2025-04-11T09:28:11.712Z (about 1 year ago)
- Topics: 2fa, demo, duo, go, golang, websdk
- Language: Go
- Homepage: https://duo.com/docs/duoweb
- Size: 16.6 KB
- Stars: 13
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Overview
[](https://travis-ci.org/mschwager/duo_go)
[](https://coveralls.io/github/mschwager/duo_go?branch=master)
[](https://goreportcard.com/report/github.com/mschwager/duo_go)
[](https://pkg.go.dev/github.com/mschwager/duo_go)
[](https://pkg.go.dev/mod/github.com/mschwager/duo_go)
**duo_go** - Duo 2FA for Go web applications: https://duo.com/docs/duoweb
# Installing
```
$ go get github.com/mschwager/duo_go
```
# Using
Here's a short snippet of code demonstrating the library:
```go
package main
import (
"fmt"
"github.com/mschwager/duo_go"
)
func main() {
duo_configuration := &duo_go.Web{
Ikey: "",
Skey: "",
Akey: "",
}
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.
# Demo
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
```
# Testing
```
$ go test
```