Update README.md
1 file changed
tree: 930b53b6260267f742dd3dec67cf292ba95665ab
  1. LICENSE.md
  2. README.md
  3. authorization.go
  4. authorization_test.go
  5. digest_auth_client.go
  6. tests/
  7. www_authenticate.go


Due to time limit on my side I won't be able to maintain this package. Please consider using some other library like https://github.com/rkl-/digest. Thanks for your support!

Golang Http Digest Authentication Client

This client implements RFC7616 HTTP Digest Access Authentication and by now the basic features should work.


// import
import dac "github.com/xinsnake/go-http-digest-auth-client"

// create a new digest authentication request
dr := dac.NewRequest(username, password, method, uri, payload)
response1, err := dr.Execute()

// check error, get response

// reuse the existing digest authentication request so no extra request is needed
dr.UpdateRequest(username, password, method, uri, payload)
response2, err := dr.Execute()

// check error, get response

Or you can use it with http.Request

t := dac.NewTransport(username, password)
req, err := http.NewRequest(method, uri, payload)

if err != nil {

resp, err := t.RoundTrip(req)
if err != nil {
defer resp.Body.Close()