Skip to content
This repository has been archived by the owner on Sep 7, 2023. It is now read-only.

Debugging

Barry de Graaff edited this page Aug 30, 2018 · 1 revision
     signOn
     https://zimbradev/service/extension/rocket?action=signOn
     This URL needs to be configured in Rocket Chat under
     Administration->Accounts->Iframe->API URL
     If the user is logged into Zimbra this
     url will return an auth token to Rocket to let the user login.
     
     redirect
     https://zimbradev/service/extension/rocket?action=redirect
     This URL needs to be configured in Rocket Chat under
     Administration->Accounts->Iframe->Iframe URL
     
     This implementation uses HTTP GET
     Administration->Accounts->Iframe->Api Method = GET
     
     Before enabling the IFrame auth on Rocket, make sure to
     create an Admin account first (usually this is done at initial
     setup). You can use these credentials to debug if needed,
     but they are also needed for Zimbra to perform its actions.
     
     After enabling IFrame auth, you can no longer log-in via
     the Rocket login page. You can either follow the steps here
     to promote an account created by Zimbra to have an admin role.
     https://rocket.chat/docs/administrator-guides/restoring-an-admin/
     OR
     You can create your own account first in Rocket before enabling
     the integration and promote that to admin. Aka user.example.com.
     
     Otherwise you may lock yourself out.
     
     
     You can debug using the following commands:
     
     createUser
     Create a new user in Zimbra, make sure to set givenName and sn,
     log in as that user in Zimbra, open a tab and point it to:
     https://yourzimbra/service/extension/rocket?action=createUser
     Creates users in Rocket chat based on their Zimbra account name.
     The Zimbra Account name is mapped to the username in Rocket Chat.
     (replacing @ with . so [email protected] in Zimbra becomes
     admin.example.com in Rocket)
     
     Furthermore the users Zimbra givenName and sn (surname) are
     concatenated to the Name in Rocket. Email is email in both
     systems
     
     If it returns 500, perhaps the account already exists or your admin
     credentials configured in config.properties are wrong. Or the email
     address is already configured on Rocket.
     
     Try debug further with curl:
     
     #Get admin auth token
     curl https://beta.rocket.org:443/api/v1/login -d "username=adminUsername&password=adminPassword"
     #Copy paste from the output
     
     #create a user
     curl -H "X-Auth-Token: from above command" \
          -H "X-User-Id: from above command" \
          -H "Content-type:application/json" \
          https://beta.rocket.org/api/v1/users.create \
          -d '{"name": "My User Name", "email": "[email protected]", "password": "dfbgdyE%^&456645", "username": "exampleuser.zimbra.com"}'
     
     
     Create a user token (used for login)
     curl -H "X-Auth-Token: from above command" \
          -H "X-User-Id: from above command" \
          -H "Content-type:application/json" \
          https://beta.rocket.org:443/api/v1/users.createToken \
          -d '{ "username": "exampleuser.zimbra.com" }'
     
     This command will tell you why the creation of a user failed.
Clone this wiki locally