Openfire custom Authentication

Hi,

we want to use our own authentication with Openfire.

To do this, we implemented our own class that inherits from org.jivesoftware.openfire.auth.JDBCAuthProvider ,

and we changed the config XML file :


<provider>
    <auth>
      <className>org.jivesoftware.openfire.auth.OurOwnJDBCAuthProvider</className>
    </auth>
...

This works well, but it requires us to compile our own version of openfire, which not the best for deployment and for maintainability.

So we thought about plugin mecanism.

Would it be possible to do this with a plugin ?

I tried to make a plugin, with only one class (OurOwnJDBCAuthProvider) , but the authentication failed (maybe the class for auth is loaded before the plugins ?).

Do you think it is possible to use a plugin for such a thing ?

Did I make something wrong ?

Thank you for your answers,

Marc.

Instead of making plugin. You can compile this class separate and make a jar file for that class and put this class in lib folder of openfire.

This would be work for you and you need n’t to compile the whole openfire.

Hi Vishu, and thank for your answer.

I didn’t try your solution yet. I will right now to test, but I was wondering : all the classes in lib directory are loaded ? before the plugin classes ?

If it works, it could answer my problem, but it would be easier (for deploying and installation) to use the plugin mecanism.

Do you think it is possible ?

Thank you,

MarC;

Hi Marc,

I am using the method that I suggested. We made separate jar file for our custmized code and put it in Lib folder and it works fine for us.

Using plugin I think it may not be possible. You can try for this. I only suggest the way which I used.

Thank you for your answer Vishu,

It works fine !

I’m gonna use your solution, I just need to find a proper way to add the jar file when we deploy the server.

Thanks again,

Marc.

marc.nazarian wrote:

I didn’t try your solution yet. I will right now to test, but I was wondering : all the classes in lib directory are loaded ? before the plugin classes ?

Hi Marc,

I wanted to jump in here real quick and point you to this thread which explains why plugins can’t be used to handle authentication.

Cheers,

Ryan

Ok, thanks Ryan, everything is clear now !

MarC;