Project

General

Profile

get http api `/rest/avatar/admin@domin`

boscattle jiang
Added over 1 year ago

I config basic auth. when i get http api http://127.0.0.1:8080/rest/adhoc/sess-man@dc-a4b8eb92-xmpp.jiangtao.tech.',I got a 403 error.

desc:

To access URI = '/rest/adhoc/sess-man@dc-a4b8eb92-xmpp.jiangtao.tech.' a valid api key is required

init.properties:

--comp-name-1=http

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

http/ports[i]=8080

http/api-key[s]=open_access

http/server-class[s]=tigase.http.jetty.JettyStandaloneHttpServer

How should i solve it?


Replies (3)

Added by Andrzej Wójcik IoT 1 CloudTigaseTeam over 1 year ago

Which version of Tigase XMPP Server are you using? Depending on version there might be small differences between configuration which is required.

Assuming you are using latest stable version 7.1.0 or 7.1.1-SNAPSHOT, then your config should look like this:

--comp-name-1=http
--comp-class-1=tigase.http.HttpMessageReceiver
http/http/ports[i]=8080
http/http/server-class[s]=tigase.http.jetty.JettyStandaloneHttpServer
http/rest/api-key[s]=open_access

Added by boscattle jiang over 1 year ago

thanks your response.

My Tigase version is 7.0.4. I change the config according your metion. But still have this error.

config:

  1. http rest

--comp-name-1=http

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

http/ports[i]=8080

http/rest/api-key[s]=open_access

http/server-class[s]=tigase.http.jetty.JettyStandaloneHttpServer

On 2 Jun 2017, at 01:40, support@tigase.org wrote:

Added by Andrzej Wójcik IoT 1 CloudTigaseTeam over 1 year ago

Ok, I just realized that you are asking about two different things. In the topic, you entered /rest/avatar/admin@domain which will work with a configuration which I provided.

But to execute ad-hoc commands, you need to pass valid admin user credentials. You need to pass JID (@user@domain@) as a username and password as a password for basic authentication to allow the server to confirm that you are allowed to execute ad-hoc commands.

    (1-3/3)