Skip to content

Commit

Permalink
Removed ONVIF authenticate flag (will always authenticate if there's …
Browse files Browse the repository at this point in the history
…a username)
  • Loading branch information
ethan-beauc committed Dec 22, 2023
1 parent edca3e5 commit 0cb4703
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public DeviceService(String deviceServiceAddress, String u, String p) {
namespace = "http://www.onvif.org/ver10/device/wsdl";
username = u;
password = p;
authenticate = false;
}

public static DeviceService getDeviceService(String deviceServiceAddress, String u, String p) {
Expand Down Expand Up @@ -70,7 +69,6 @@ public Document getScopesDocument() {

/** Get the scope parameters of the device */
public String getScopes() {
authenticate = true;
Document doc = getScopesDocument();
return sendRequestDocument(doc);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public ImagingService(String imagingServiceAddress, String u, String p) {
namespace = "http://www.onvif.org/ver20/imaging/wsdl";
username = u;
password = p;
authenticate = true;
}

public static ImagingService getImagingService(String imagingServiceAddress, String u, String p) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public MediaService(String mediaServiceAddress, String u, String p) {
namespace = "http://www.onvif.org/ver10/media/wsdl";
username = u;
password = p;
authenticate = true;
}

public static MediaService getMediaService(String mediaServiceAddress, String u, String p) {
Expand Down
2 changes: 0 additions & 2 deletions src/us/mn/state/dot/tms/server/comm/onvifptz/PTZService.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public PTZService(String ptzServiceAddress, String u, String p) {
namespace = "http://www.onvif.org/ver20/ptz/wsdl";
username = u;
password = p;
authenticate = true;
}

public static PTZService getPTZService(String ptzServiceAddress, String u, String p) {
Expand Down Expand Up @@ -350,7 +349,6 @@ public Document getAuxiliaryCommandDocument(String profToken, String command, St
* @param state the requested state ("On", "Off") of the wiper
*/
public String setWiper(String profileToken, String state) {
authenticate = true;
Document doc = getAuxiliaryCommandDocument(profileToken, "Wiper", state);
return sendRequestDocument(doc);
}
Expand Down
3 changes: 1 addition & 2 deletions src/us/mn/state/dot/tms/server/comm/onvifptz/Service.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ public abstract class Service {
protected String namespace;
protected String username;
protected String password;
protected boolean authenticate;

/** Logger method */
protected void log(String s) {
Expand Down Expand Up @@ -174,7 +173,7 @@ public String sendRequestDocument(Document doc) {
connection.setDoOutput(true);
connection.setRequestProperty("Content-Type", "application/soap+xml; charset=utf-8");

if (authenticate && !"".equals(username)) {
if (!"".equals(username)) {
addSecurityHeaderDocument(doc);
} else {
log("Sending unauthenticated request...");
Expand Down

0 comments on commit 0cb4703

Please sign in to comment.