Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Actions that require authentication no longer work #58

Closed
Hexer10 opened this issue Feb 17, 2024 · 8 comments
Closed

Actions that require authentication no longer work #58

Hexer10 opened this issue Feb 17, 2024 · 8 comments

Comments

@Hexer10
Copy link

Hexer10 commented Feb 17, 2024

After the commit 89841e4 every action that requires authentication throws this error:

$ onvif media1 get-profiles

Unhandled exception:
Exception: Error code: {"Code":{"Value":"s:Sender","Subcode":{"Value":{"$":"ter:NotAuthorized"}}},"Reason":{"lang":"en","note":"Wsse authorized time check failed."},"Node":null,"Role":null,"Detail":null}
#0      Transport.sendRequest (package:easy_onvif/src/soap/transport.dart:46:13)
<asynchronous suspension>
#1      Media1.getProfiles (package:easy_onvif/src/media1.dart:96:22)
<asynchronous suspension>
#2      OnvifGetProfiles1MediaCommand.run (package:easy_onvif/src/cmd/onvif_media1_command.dart:178:24)
<asynchronous suspension>
#3      CommandRunner.runCommand (package:args/command_runner.dart:212:13)
<asynchronous suspension>

If I downgrade the package to v2.1.2+13 I get the proper output:

$ onvif media1 get-profiles
[{"@token":"MediaProfile00000","@fixed":true,"Name":"MediaProfile_Channel1_MainStream", ...]

I'm running these commands on a Dahua NVR

@faithoflifedev
Copy link
Owner

@Hexer10, do you know which version you downgraded from?

I just tested with v2.2.0+1 and everything is working as expected. Reading through the changelog it looks like this got resolved for v2.2.0

@Hexer10
Copy link
Author

Hexer10 commented Feb 17, 2024

@faithoflifedev I downgraded from version v2.2.0+2, here is the full terminal output:

$ onvif version
easy_onvif v2.2.0+2

$ onvif media1 get-profiles
Unhandled exception:
Exception: Error code: {"Code":{"Value":"s:Sender","Subcode":{"Value":{"$":"ter:NotAuthorized"}}},"Reason":{"lang":"en","note":"Wsse authorized time check failed."},"Node":null,"Role":null,"Detail":null}
#0      Transport.sendRequest (package:easy_onvif/src/soap/transport.dart:46:13)
<asynchronous suspension>
#1      Media1.getProfiles (package:easy_onvif/src/media1.dart:96:22)
<asynchronous suspension>
#2      OnvifGetProfiles1MediaCommand.run (package:easy_onvif/src/cmd/onvif_media1_command.dart:178:24)
<asynchronous suspension>
#3      CommandRunner.runCommand (package:args/command_runner.dart:212:13)
<asynchronous suspension>
Unhandled exception:
Exception: Error code: {"Code":{"Value":"s:Sender","Subcode":{"Value":{"$":"ter:NotAuthorized"}}},"Reason":{"lang":"en","note":"Wsse authorized time check failed."},"Node":null,"Role":null,"Detail":null}
#0      Transport.sendRequest (package:easy_onvif/src/soap/transport.dart:46:13)
<asynchronous suspension>
#1      Media1.getProfiles (package:easy_onvif/src/media1.dart:96:22)
<asynchronous suspension>
#2      OnvifGetProfiles1MediaCommand.run (package:easy_onvif/src/cmd/onvif_media1_command.dart:178:24)
<asynchronous suspension>
#3      CommandRunner.runCommand (package:args/command_runner.dart:212:13)
<asynchronous suspension>

$ dart pub global activate easy_onvif 2.1.2+13 // <-- Downgrade version
Package easy_onvif is currently active at version 2.2.0+2.
[...]
Building package executables... (2.2s)
Built easy_onvif:onvif.
Installed executable onvif.
Activated easy_onvif 2.1.2+13.

$ onvif version
easy_onvif v2.1.2+13

$ onvif media1 get-profiles
[{"@token":"MediaProfile00000", ...]

@faithoflifedev
Copy link
Owner

Thanks @Hexer10 for this helpful feedback.

Using easy_onvif v2.2.0+2

Can you run the command:

onvif media1 get-profiles --log-level all

This will show the XML Request/Response communication between the code and the device and hopefully will show what might be causing the issue.

@Hexer10
Copy link
Author

Hexer10 commented Feb 17, 2024

Thanks @Hexer10 for this helpful feedback.

Using easy_onvif v2.2.0+2

Can you run the command:

onvif media1 get-profiles --log-level all

This will show the XML Request/Response communication between the code and the device and hopefully will show what might be causing the issue.

Sure, here is the output https://gist.github.com/Hexer10/680ea4ea489c505b7606163d1b392c75

@faithoflifedev
Copy link
Owner

HI @Hexer10 ,

I just published easy_onvif: ^2.3.0, I reverted some of the authentication code back to v2.1.2+13.

@Hexer10
Copy link
Author

Hexer10 commented Feb 18, 2024

Hi @faithoflifedev , thanks for your help! Unfortunately I still get the same errors even on v2.3.0+1. If it can help I've uploaded here https://gist.github.com/Hexer10/b0ff9a8bf3784cae32591f9afea588a2 the logs on both v2.1.2+13 and v2.3.0+1, as well as the generated file of onvif debug (on v2.3.0+1).

I also wanted to add that I get this error only on my Dahua NVR, if I try other cams they work fine both on 2.3.0+1 and 2.1.2+13.

@faithoflifedev
Copy link
Owner

Hi @Hexer10 , thanks for the additional debug info.

Unfortunately, I don't have access to a device that gives the same error. However I believe I've made some progress. Please give my latest release a try and let me know if the issue is resolved.

@Hexer10
Copy link
Author

Hexer10 commented Feb 20, 2024

Thanks a lot for your help! On v3.0.0-dev.1 now it's working properly

@Hexer10 Hexer10 closed this as completed Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants