Project

General

Profile

Tigase intercepter/Entry point

Abdul Aziz
Added 25 days ago

I want to add my custom authentication when someone tries to access my tigase server.
What is the entry point of server how should I check whether this request is coming from authenticated user.

I am new to tigase server development so any help would be appreciated.


Replies (5)

Added by Wojciech Kapcia TigaseTeam 24 days ago

I would recommend starting with read-up Writing Plugin Code.

Authentication in general is performed via SASL (SASL Custom Mechanisms and Configuration) so you could modify existing SASL mechanism or create your own.

Processing itself in general is limited to authenticated users, however if you only want to check if particular packet comes from authenticated user, in your plugin/filter you can use tigase.xmpp.XMPPResourceConnection#isAuthorized.

Added by Abdul Aziz 24 days ago

I am running tigase server but its not reading my init.properties file.
I am attaching my init.properties file and logs for you.

I am using linux.

logs chunk

componentInfo{Title=Tigase XML Tools, Version=3.5.0-b252/d7b28574, Class=tigase.xml.XMLUtils}
componentInfo{Title=Tigase Utils, Version=3.5.1-b330/0c349498, Class=tigase.util.ClassUtil}
componentInfo{Class=tigase.server.XMPPServer}
2019-01-30 15:37:35.970 [main]             ConfiguratorAbstract.parseArgs()   WARNING:  No property file not specified! Using default one etc/init.properties
2019-01-30 15:37:35.983 [main]             ConfiguratorAbstract.parseArgs()   CONFIG:   Loading initial properties from property file: etc/init.properties
2019-01-30 15:37:35.983 [main]             ConfiguratorAbstract.parseArgs()   CONFIG:   Added default config parameter: (--comp-class-1=tigase.http.HttpMessageReceiver)
2019-01-30 15:37:35.984 [main]             ConfiguratorAbstract.parseArgs()   CONFIG:   Added default config parameter: (--admins=admin@$HOST_NAME)
2019-01-30 15:37:35.984 [main]             ConfiguratorAbstract.parseArgs()   CONFIG:   Added default config parameter: (config-type=--gen-config-def)
2019-01-30 15:37:35.984 [main]             ConfiguratorAbstract.parseArgs()   CONFIG:   Added default config parameter: (--virt-hosts=$HOST_NAME)
2019-01-30 15:37:35.984 [main]             ConfiguratorAbstract.parseArgs()   CONFIG:   Added default config parameter: (--debug=server)
2019-01-30 15:37:35.984 [main]             ConfiguratorAbstract.parseArgs()   CONFIG:   Added default config parameter: (--comp-name-1=http)
2019-01-30 15:37:35.993 [main]             DNSResolverDefault.<init>()        WARNING:  Resolving default host name: administrator-optiplex-7040 took: 5
2019-01-30 15:37:36.002 [main]             AbstractMessageReceiver.setMaxQueueSize()  FINEST: message-router maxQueueSize: 9,279, maxInQueueSize: 578, maxOutQueueSize: 18,558
2019-01-30 15:37:36.004 [main]             MessageRouter.addRegistrator()     INFO:     Adding registrator: Configurator
2019-01-30 15:37:36.004 [main]             MessageRouter.addComponent()       INFO:     Adding component: 
2019-01-30 15:37:36.004 [main]             ConfiguratorAbstract.componentAdded()  CONFIG:  component: basic-conf
2019-01-30 15:37:36.004 [main]             ConfiguratorAbstract.setup()       CONFIG:   Setting up component: basic-conf
2019-01-30 15:37:36.152 [main]             ConfiguratorAbstract.setup()       CONFIG:   Component basic-conf defaults: {component-id=basic-conf@administrator-optiplex-7040, def-hostname=administrator-optiplex-7040, admins=[Ljava.lang.String;@4f8e5cde, scripts-dir=scripts/admin, command/ALL=ADMIN, logging/.level=CONFIG, logging/handlers=java.util.logging.ConsoleHandler java.util.logging.FileHandler, logging/java.util.logging.ConsoleHandler.formatter=tigase.util.LogFormatter, logging/java.util.logging.ConsoleHandler.level=WARNING, logging/java.util.logging.FileHandler.append=true, logging/java.util.logging.FileHandler.count=5, logging/java.util.logging.FileHandler.formatter=tigase.util.LogFormatter, logging/java.util.logging.FileHandler.limit=10000000, logging/java.util.logging.FileHandler.pattern=logs/tigase.log, logging/tigase.useParentHandlers=true, logging/java.util.logging.FileHandler.level=ALL, logging/tigase.server.level=ALL, user-domain-repo-pool=tigase.db.UserRepositoryMDImpl, auth-domain-repo-pool=tigase.db.AuthRepositoryMDImpl, user-repo-pool-size=32, data-repo-pool-size=32, user-repo-url=jdbc:derby:tigase-derbydb;create=true, auth-repo-url=jdbc:derby:tigase-derbydb;create=true, ssl-container-class=tigase.io.jdk18.SNISSLContextContainer, ssl-certs-location=certs/, ssl-def-cert-domain=default, config-dump-file=etc/config-dump.properties}
2019-01-30 15:37:36.152 [main]             ConfiguratorAbstract.setup()       CONFIG:   Component basic-conf configuration: {component-id=basic-conf@administrator-optiplex-7040, def-hostname=administrator-optiplex-7040, admins=[Ljava.lang.String;@4f8e5cde, scripts-dir=scripts/admin, command/ALL=ADMIN, logging/.level=CONFIG, logging/handlers=java.util.logging.ConsoleHandler java.util.logging.FileHandler, logging/java.util.logging.ConsoleHandler.formatter=tigase.util.LogFormatter, logging/java.util.logging.ConsoleHandler.level=WARNING, logging/java.util.logging.FileHandler.append=true, logging/java.util.logging.FileHandler.count=5, logging/java.util.logging.FileHandler.formatter=tigase.util.LogFormatter, logging/java.util.logging.FileHandler.limit=10000000, logging/java.util.logging.FileHandler.pattern=logs/tigase.log, logging/tigase.useParentHandlers=true, logging/java.util.logging.FileHandler.level=ALL, logging/tigase.server.level=ALL, user-domain-repo-pool=tigase.db.UserRepositoryMDImpl, auth-domain-repo-pool=tigase.db.AuthRepositoryMDImpl, user-repo-pool-size=32, data-repo-pool-size=32, user-repo-url=jdbc:derby:tigase-derbydb;create=true, auth-repo-url=jdbc:derby:tigase-derbydb;create=true, ssl-container-class=tigase.io.jdk18.SNISSLContextContainer, ssl-certs-location=certs/, ssl-def-cert-domain=default, config-dump-file=etc/config-dump.properties}
2019-01-30 15:37:36.152 [main]             ConfiguratorAbstract.setProperties()  INFO:  Propeties size is 31, and here are all propeties: {component-id=basic-conf@administrator-optiplex-7040, def-hostname=administrator-optiplex-7040, admins=[Ljava.lang.String;@4f8e5cde, scripts-dir=scripts/admin, command/ALL=ADMIN, logging/.level=CONFIG, logging/handlers=java.util.logging.ConsoleHandler java.util.logging.FileHandler, logging/java.util.logging.ConsoleHandler.formatter=tigase.util.LogFormatter, logging/java.util.logging.ConsoleHandler.level=WARNING, logging/java.util.logging.FileHandler.append=true, logging/java.util.logging.FileHandler.count=5, logging/java.util.logging.FileHandler.formatter=tigase.util.LogFormatter, logging/java.util.logging.FileHandler.limit=10000000, logging/java.util.logging.FileHandler.pattern=logs/tigase.log, logging/tigase.useParentHandlers=true, logging/java.util.logging.FileHandler.level=ALL, logging/tigase.server.level=ALL, user-domain-repo-pool=tigase.db.UserRepositoryMDImpl, auth-domain-repo-pool=tigase.db.AuthRepositoryMDImpl, user-repo-pool-size=32, data-repo-pool-size=32, user-repo-url=jdbc:derby:tigase-derbydb;create=true, auth-repo-url=jdbc:derby:tigase-derbydb;create=true, ssl-container-class=tigase.io.jdk18.SNISSLContextContainer, ssl-certs-location=certs/, ssl-def-cert-domain=default, config-dump-file=etc/config-dump.properties, shared-user-repo=null, shared-user-repo-params=null, shared-auth-repo=null, shared-auth-repo-params=null}
2019-01-30 15:37:36.210 [main]             DataRepositoryImpl.initRepository()  SEVERE: null
java.lang.ClassNotFoundException: org.apache.derby.jdbc.EmbeddedDriver
    at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)

Added by Wojciech Kapcia TigaseTeam 22 days ago

componentInfo{Class=tigase.server.XMPPServer}
2019-01-30 15:37:35.970 [main]             ConfiguratorAbstract.parseArgs()   WARNING:  No property file not specified! Using default one etc/init.properties
2019-01-30 15:37:35.983 [main]             ConfiguratorAbstract.parseArgs()   CONFIG:   Loading initial properties from property file: etc/init.properties

First line indicates that you are using your own build of Tigase server (most likely debug from IDE) -- please make sure that main execution path is set correctly. You can also specify explicitely path to your configuration file with additional parameter to XMPPServer: --property-file path/to/etc/init.properties

Added by Abdul Aziz 17 days ago

Dear Wojciech Kapcia,

Thank you for your support.

I have successfully run tigase server from Eclipse IDE and connected two chat applications (Psi and Pidgen).

Now my bigger concern in to implement my custom OAuth connector.

Can you please point me in the right direction.

  1. Should I go for Plugin or Component.

  2. Is there any already OAuth Plugin available or not.

3.Where should I intercept the request to perform Authentication.

Added by Wojciech Kapcia TigaseTeam 16 days ago

There would be two parts to it:

    (1-5/5)