I’m trying to put together a module that authenticates users against our database instead of the the publish.password file.
I’m using Adobe Flash Media Encoder to do streaming.
It looks like I need to implement ModuleRTMPAuthenticate.onConnect, but onConnect doesn’t seem to like people playing with it.
FME connects, but when I try to Publish, I always get:
Status: NetStream.Publish.Failed
No other info is provided, even in the logs.
Also, I’ve tried it with and without the rtmpEncoderAuthenticatorFile property in Application.xml. It doesnt seem to make a difference.
Here’s some test code I was running:
public class testAuthentication extends ModuleRTMPAuthenticate{
public void onConnect(IClient client, RequestFunction function,AMFDataList params) {
getLogger().info("testAuthentication.onConnect");
client.acceptConnection();
}
}
On a side note, I can accomplish what I want to do using the publish() method from ModuleBase, but it doesn’t fail as gracefully…there’s no pop-up box that appears for user/pass (has to be passed in then URL), and it FME hangs for a couple seconds when it receives client.rejectConnection() from publish().
So I’d really like it to behave like a “regular” FME session…password pop-up on connect, etc.
I’ve tried switching the order of the modules, basic & digest authentication and looked around for RTMP specific functions. Any idea what I may be doing wrong?
Thanks for your help. I’ve got the authentication working now. But I was hoping I could get a reference to the the client within the getPassword() method. Something like:
Then if you implement a class as described here and set the property in the application properties then it will call your class to do the authentication.