Project

General

Profile

XMPP admin access and API issue

JP Tiwari
Added 21 days ago

Hi,

I am unable to access admin of tigase server. can you please help me? init.properties file attached.

One more thing, I am creating user using REST API http://192.168.168.31:8080/rest/user/test@gmail.com with payload test12345 but getting error "To access URI = '/rest/user/jptiwari@gmail.com' a valid api key is required". Can you please let me what api key I should use and where?

Please see attached screenshot for payload and api call.

Thanks,
JP


Replies (10)

Added by Wojciech Kapcia TigaseTeam 20 days ago

JP Tiwari wrote:

I am unable to access admin of tigase server. can you please help me? init.properties file attached.

You should use either:

  • credentials of one of the admin users (complete JID and password) or
  • credentials configured in init.properties:
http/setup/admin-credentials=root:root

One more thing, I am creating user using REST API http://192.168.168.31:8080/rest/user/test@gmail.com with payload test12345 but getting error "To access URI = '/rest/user/jptiwari@gmail.com' a valid api key is required". Can you please let me what api key I should use and where?

You should configure API KEYS (see RestModule configuration). If you don't want to use API KEYs you can configure open access with following configuration:

--api-keys=open_access

Added by JP Tiwari 20 days ago

Hi,

Thank you for your reply.

User create, avatar change, password change APIs are working.

Can you please let me know that why following APIs are not working:
GET: http://192.168.168.31:8080/rest/users/ //Output: Not authorized
DELETE: http://192.168.168.31:8080/rest/user/tigaseuser@gmail.com //Output: null, Comment: User is not deleting
GET: http://192.168.168.31:8080/rest/user/tigaseuser@gmail.com //Output: null
GET: http://192.168.168.31:8080/rest/avatar/tigaseuser@gmail.com/vcard4

I am still unable to access admin area http://192.168.168.31:8080/admin/ with username 'root' and password 'root'.

What is the way to get/generate {component_jid}, {to_jid}, {pubsub_jid}, {adhoc_command_node}?

Tigase log and mongoDB schema's screenshot attached.

Regards,
JP

Added by Wojciech Kapcia TigaseTeam 14 days ago

JP Tiwari wrote:

Hi,

Thank you for your reply.

User create, avatar change, password change APIs are working.

Can you please let me know that why following APIs are not working:

Most likely you must authorise all the requests.

I am still unable to access admin area http://192.168.168.31:8080/admin/ with username 'root' and password 'root'.

Appologies - this allows you only to access setup module. You must use one of the admin users (defined in configuration file) that is present in the repository (you have to use JID of that user!)

What is the way to get/generate {component_jid}, {to_jid}, {pubsub_jid}, {adhoc_command_node}?

I'm sorry but I don't understand the question.

Added by JP Tiwari 14 days ago

Hi,

Thank you for the response. However, I’m still having some issues even though I’m using the same authentication in other api calls which are working but for some strange reasons it’s not working with the ones I mentioned earlier.

Regarding the configuration file, can you please show me how to access it and create a new JID credentials so I can use it to access the admin?

Thanks,
JP

Added by Wojciech Kapcia TigaseTeam 12 days ago

JP Tiwari wrote:

Hi,

Thank you for the response. However, I’m still having some issues even though I’m using the same authentication in other api calls which are working but for some strange reasons it’s not working with the ones I mentioned earlier.

Could you share sample of the credentials that you use?

Regarding the configuration file, can you please show me how to access it and create a new JID credentials so I can use it to access the admin?

It's described here --admins
Please note that this only configures which JIDs would be treated as administrators - you have to create those user accounts in the repository yourself. In case of RDBMS you can execute TigAddUserPlainPw() stored procedure. In case of Mongo is a bit more complex and the easiest option would be to use In-band Registration and simply provide details/JID od the account you want to register/create.

Added by JP Tiwari 10 days ago

Could you share sample of the credentials that you use?

Please see attached screenshot

It's described here --admins
Please note that this only configures which JIDs would be treated as administrators - you have to create those user accounts in the repository yourself. In case of RDBMS you can execute TigAddUserPlainPw() stored procedure. In case of Mongo is a bit more complex and the easiest option would be to use In-band Registration and simply provide details/JID od the account you want to register/create.

I have created user using the API "PUT/rest/user/{user_jid}" but getting error when trying to access the admin panel via the user's credentials as admin. Screenshot: https://drive.google.com/file/d/1Y3PHuOh0eRw4oXnxTEe4vnI6av_4U9Jc/view?usp=drivesdk

Can you please share a sample code for mysql and mongodb of how to create a JID in the repository?

Added by JP Tiwari 9 days ago

Hi,

We have created another instance of tigase server with MYSQL and ran the command "call TigAddUserPlainPw('tigaseuser@server31', 'pass123');", It has created the user under "tig_users" DB table but I am still unable to access admin panel via the login details.

For Your Info: I have setup tigase at local server that have IP 192.168.168.31, I am assuming there is no need to setup tigase on globally access server.

Thank You

Added by Wojciech Kapcia TigaseTeam 8 days ago

JP Tiwari wrote:

Can you please share a sample code for mysql and mongodb of how to create a JID in the repository?

It's not possible to add user by hand with MongoDB.

JP Tiwari wrote:

We have created another instance of tigase server with MYSQL and ran the command "call TigAddUserPlainPw('tigaseuser@server31', 'pass123');", It has created the user under "tig_users" DB table but I am still unable to access admin panel via the login details.

Which URL are you using?
The configuration looks ok.

As for Postman - it looks like you are not authorising the request (you haven't include Authorization tab so that's mostly a guess).

For Your Info: I have setup tigase at local server that have IP 192.168.168.31, I am assuming there is no need to setup tigase on globally access server.

Yes, this is the IP - by default it uses port 8080.

Added by JP Tiwari 8 days ago

Hi,

Thank you for checking the configuration. I am adding videos in the message to understand issue more clearly.

I am unable to access/use following tabs, Please see video:-
Admin Authntication Failed: https://drive.google.com/file/d/1i7O2rIgKi5ksT7f67t9pyAyOjae_KaP9/view?usp=drivesdk

Server tab: https://drive.google.com/file/d/13LZG9qR_E9GYJmuGIPD3joiHrFu5za7p/view?usp=drivesdk

User interface tab: It doesn't allow to register/login. https://drive.google.com/file/d/1TN5tIRh0tlUXahboB5KNWo7bTqTN3aPq/view?usp=drivesdk

As for Postman - it looks like you are not authorising the request (you haven't include Authorization tab so that's mostly a guess).

but, I am able to create user using same API configuration 'http://192.168.168.31:8080/rest/user/jptiwari@gmail.com'. Screenshot attached.

Regards,
JP

Added by Wojciech Kapcia TigaseTeam about 12 hours ago

JP Tiwari wrote:

Hi,

Thank you for checking the configuration. I am adding videos in the message to understand issue more clearly.

I am unable to access/use following tabs, Please see video:-
Admin Authntication Failed: https://drive.google.com/file/d/1i7O2rIgKi5ksT7f67t9pyAyOjae_KaP9/view?usp=drivesdk

Server tab: https://drive.google.com/file/d/13LZG9qR_E9GYJmuGIPD3joiHrFu5za7p/view?usp=drivesdk

User interface tab: It doesn't allow to register/login. https://drive.google.com/file/d/1TN5tIRh0tlUXahboB5KNWo7bTqTN3aPq/view?usp=drivesdk

I don't have access to those videos - please share them in open manner.

As for Postman - it looks like you are not authorising the request (you haven't include Authorization tab so that's mostly a guess).

but, I am able to create user using same API configuration 'http://192.168.168.31:8080/rest/user/jptiwari@gmail.com'. Screenshot attached.

Try adding to init.properties:
--admins=jptiwari@gmail.com

When providing information please provide all details - in case of Postman details from all tabs.

    (1-10/10)