Skip to content

Commit

Permalink
add user/passworld
Browse files Browse the repository at this point in the history
Signed-off-by: Jieke Choo <[email protected]>
  • Loading branch information
jiekechoo committed Jun 25, 2024
1 parent 5a7c40b commit 8ce5f02
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Device.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ import (
"encoding/xml"
"errors"
"fmt"
"github.com/IOTechSystems/onvif/xsd/onvif"
"io/ioutil"
"net/http"
"net/url"
"reflect"
"strconv"
"strings"

"github.com/IOTechSystems/onvif/xsd/onvif"

"github.com/IOTechSystems/onvif/device"
"github.com/IOTechSystems/onvif/gosoap"
"github.com/IOTechSystems/onvif/networking"
Expand Down Expand Up @@ -380,6 +381,9 @@ func (dev *Device) SendGetSnapshotRequest(url string) (resp *http.Response, err
}
// Basic auth might work for some camera
req.SetBasicAuth(dev.params.Username, dev.params.Password)
req.SetPathValue("user", dev.params.Username)
req.SetPathValue("pwd", dev.params.Password)
req.SetPathValue("password", dev.params.Password)
resp, err = dev.params.HttpClient.Do(req)

} else if dev.params.AuthMode == DigestAuth || dev.params.AuthMode == Both {
Expand Down

0 comments on commit 8ce5f02

Please sign in to comment.