Project

General

Profile

Tigase 7.x REST API problems

Steffen Larsen
Added about 3 years ago

Hi there,

After upgrading to tigase 7.x I've had problems making our REST api work. I have updated the class name to the new one, but still It gives me problems.

When I am POSTing on the rest interface I get

@

To access URI = '/rest/adhoc/sess-man@xxxxxx' a valid api key is required

@

I have tried with and without the api-key set in init.properties.

The properties look like this:

@# Rest interface setup. it default uses port 8080

--comp-name-2=rest

--comp-class-2=tigase.http.HttpMessageReceiver

#rest/api-keys[s]=qwerty@

I basically just want it to be open (no API key). and according to the doc, I should just be able to leave it out.

I'cant really see anything in the log.

Any ideas? classpath problems or anything ??.. The log is silent. :-)

My jars directory:

@drwxr-xr-x. 11 root root 4096 Dec 7 13:33 ../

rw-r--r- 1 root root 2709614 Dec 7 13:15 derby.jar

rw-r--r- 1 root root 177181 Dec 7 13:15 derbytools.jar

rw-r--r- 1 root root 6322883 Dec 7 13:15 groovy-all.jar

rw-r--r- 1 root root 44974 Dec 7 13:15 hamcrest-core.jar

rw-r--r- 1 root root 95691 Dec 7 13:15 javax.servlet-api.jar

rw-r--r- 1 root root 1167171 Dec 7 13:15 jdmkrt.jar

rw-r--r- 1 root root 103983 Dec 7 13:15 jetty-http.jar

rw-r--r- 1 root root 103753 Dec 7 13:15 jetty-io.jar

rw-r--r- 1 root root 96014 Dec 7 13:15 jetty-security.jar

rw-r--r- 1 root root 406910 Dec 7 13:15 jetty-server.jar

rw-r--r- 1 root root 111819 Dec 7 13:15 jetty-servlet.jar

rw-r--r- 1 root root 341392 Dec 7 13:15 jetty-util.jar

rw-r--r- 1 root root 68197 Dec 7 13:15 jstun.jar

rw-r--r- 1 root root 301107 Dec 7 13:15 jtds.jar

rw-r--r- 1 root root 4956 Dec 7 13:15 jul-to-slf4j.jar

rw-r--r- 1 root root 22619 Dec 7 13:15 licence-lib.jar

rw-r--r- 1 root root 246488 Dec 7 13:15 logback-classic.jar

rw-r--r- 1 root root 327655 Dec 7 13:15 logback-core.jar

-rwxr-xr-x. 1 root root 92920 Dec 7 10:15 logstash-util-formatter-1.0-SNAPSHOT-shaded.jar

rw-r--r- 1 root root 590587 Dec 7 13:15 mongo-java-driver.jar

rw-r--r- 1 root root 728303 Dec 7 13:15 mysql-connector-java.jar

rw-r--r- 1 root root 166197 Dec 7 13:15 org.apache.felix.bundlerepository.jar

rw-r--r- 1 root root 112889 Dec 7 13:15 org.apache.felix.configadmin.jar

rw-r--r- 1 root root 528731 Dec 7 13:15 org.apache.felix.main.jar

rw-r--r- 1 root root 61766 Dec 7 13:15 org.apache.felix.shell.jar

rw-r--r- 1 root root 24651 Dec 7 13:15 org.apache.felix.shell.remote.jar

rw-r--r- 1 root root 161077 Dec 7 13:15 org.osgi.core.jar

rw-r--r- 1 root root 546028 Dec 7 13:15 postgresql.jar

rw-r--r- 1 root root 26063 Dec 7 13:15 slf4j-api.jar

rw-r--r- 1 root root 65253 Dec 7 13:15 tigase-acs-muc.jar

rw-r--r- 1 root root 21379 Dec 7 13:15 tigase-acs-pubsub.jar

rw-r--r- 1 root root 51856 Dec 7 13:15 tigase-acs.jar

rw-r--r- 1 root root 43427 Dec 7 13:15 tigase-extras.jar

rw-r--r- 1 root root 15990 Dec 7 13:15 tigase-http-api-jetty.jar

rw-r--r- 1 root root 206786 Dec 7 13:15 tigase-http-api.jar

rw-r--r- 1 root root 54551 Dec 7 13:15 tigase-message-archiving.jar

rw-r--r- 1 root root 56994 Dec 7 13:15 tigase-mongodb.jar

rw-r--r- 1 root root 155752 Dec 7 13:15 tigase-muc.jar

rw-r--r- 1 root root 274716 Dec 7 13:15 tigase-pubsub-2.2.0.jar.old

rw-r--r- 1 root root 351011 Dec 7 13:15 tigase-pubsub.jar

rw-r--r- 1 root root 1974230 Dec 7 13:15 tigase-server.jar

rw-r--r- 1 root root 59601 Dec 7 13:15 tigase-socks5.jar

rw-r--r- 1 root root 8791 Dec 7 13:15 tigase-stats-collector-library.jar

rw-r--r- 1 root root 8141 Dec 7 13:15 tigase-stats-collector-provider.jar

rw-r--r- 1 root root 12229 Dec 7 13:15 tigase-stun.jar

rw-r--r- 1 root root 6998410 Dec 7 13:15 tigase-web-ui.war@

-Cheers!


Replies (4)

Added by Wojciech Kapcia TigaseTeam about 3 years ago

HTTP API component documentation (https://projects.tigase.org/projects/tigase-http-api/wiki/Configuration) explains:

api-keys[s] - comma separated list of strings which would be possible to use as keys to pass api-key parameter to request to authorize request execution (if nothing is passed then no request will be allowed, to allow any request this property needs to be set to open_access)

hence following will disable requirement for API key:

--api-keys=open_access

Added by Steffen Larsen about 3 years ago

DOH my mistake.. Misread the doc. Sorry about that Wojciech!.

Just a small question. How do I disable the UI bits?.. I can't find it in https://projects.tigase.org/projects/tigase-http-api/wiki/Configuration.

Maybe its in another doc. :-)

Added by Wojciech Kapcia TigaseTeam about 3 years ago

Which "UI bits"? /admin/ or /ui/ or both? The latter can be disabled by removing jars/tigase-web-ui.war@. As for the former - deleting @scripts/admin/template.html should take care of it.

Added by Steffen Larsen almost 3 years ago

Hi W,

Sorry about the slow reply - I totally forgot this outstanding.

Yes you are correct. I can disable it by removing the wars, which is fine.

    (1-4/4)