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

webhookAuthenticateURL does not work #4058

Closed
tuliofaria opened this issue Mar 15, 2022 · 4 comments
Closed

webhookAuthenticateURL does not work #4058

tuliofaria opened this issue Mar 15, 2022 · 4 comments
Assignees

Comments

@tuliofaria
Copy link

Short description

I´m trying to use webhookAuthenticateURL and following https://github.com/ant-media/Ant-Media-Server/wiki/Webhook-Authentication-for-Publishing-Streams but, even with the URL set, I didnt receive any request on https://webhook.site/.

Checking the logs, it only appears nullpointer exception in line 59 of this file: https://github.com/ant-media/Ant-Media-Server/blob/master/src/main/java/io/antmedia/security/AcceptOnlyStreamsWithWebhook.java#L59

I´m using OBS to test and tried to send everything. Custom query params, such ?test=value but the error is the same.

Environment

  • Operating system and version: Ant Media Community from Digital Ocean marketplace
@mekya
Copy link
Contributor

mekya commented Mar 21, 2022

Thank you @tuliofaria ,

Let us take a look at your case

@yashtandon113
Copy link
Contributor

Hi @tuliofaria
Thanks for reporting this issue.
I have checked in our test environment and able to reproduce the issue, it works fine with WebRTC stream but RTMP stream does not publish with webhookAuthenticateURL.

2022-03-27 20:13:58,425 [RTMPConnectionExecutor-1] ERROR i.a.s.AcceptOnlyStreamsWithWebhook - Couldn't connect Webhook for Stream Authentication java.lang.NullPointerException
at io.antmedia.security.AcceptOnlyStreamsWithWebhook.isPublishAllowed(AcceptOnlyStreamsWithWebhook.java:59)
at org.red5.server.stream.StreamService.publish(StreamService.java:669)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.red5.server.service.ServiceInvoker.invoke(ServiceInvoker.java:189)
at org.red5.server.net.rtmp.RTMPHandler.invokeCall(RTMPHandler.java:213)
at org.red5.server.net.rtmp.RTMPHandler.onCommand(RTMPHandler.java:309)
at org.red5.server.net.rtmp.BaseRTMPHandler.messageReceived(BaseRTMPHandler.java:115)
at org.red5.server.net.rtmp.ReceivedMessageTask.call(ReceivedMessageTask.java:72)
at org.red5.server.net.rtmp.ReceivedMessageTask.call(ReceivedMessageTask.java:38)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)

2022-03-27 20:13:58,425 [RTMPConnectionExecutor-1] INFO i.a.e.webrtc.WebRTCApplication - W3C x-category:session x-event:disconnect c-ip:103.87.56.123 c-client-id:0
2022-03-27 20:13:58,426 [RTMPConnectionExecutor-1] INFO o.r.s.net.rtmp.RTMPMinaConnection - Connection is closed: 0M8RUSHDK6WPF
2022-03-27 20:13:58,427 [RTMPConnectionExecutor-1] ERROR o.red5.server.stream.StreamService - You are not allowed to publish the stream stream

@tuliofaria
Copy link
Author

Nice @yashtandon113 ! Is there any docs to start contributing to the project? I was trying to set a local environment to investigate this - but it was confusing to me (it´s been a long time I don´t have a local env for java 😓 ).

@mekya
Copy link
Contributor

mekya commented Mar 30, 2022

Hi @tuliofaria ,

Thank you for investigating the contribution. It's very kind of you.

You can just send PR to the master branch. On the other hand, we're preparing contribution guide
https://resources.antmedia.io/docs/contribution-how-to?highlight=Contribution

You can build the project with this documentation -> https://resources.antmedia.io/docs/building-ams-from-source

Please let me know if we can help further for your contribution

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

4 participants