Modify the ordering of 'digest-response'

Intel AMT implements a form of RFC 2617 that appears to expect the
ordering of 'digest-response' to follow the ordering laid out in the RFC
although not required by the RFC to be in that order.

Change-Id: I8bb567d018c4363078be00ac47fe1fd6367fb182
1 file changed
tree: bb49c35f80cf5cbfae78a47b5345171ebaf52fe1
  3. authorization.go
  4. digest_auth_client.go
  5. tests/
  6. www_authenticate.go


Golang Http Digest Authentication Client

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


// import
import dac ""

// 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()