Search code examples
javascriptjavawebquickblox

Quick blox video calling in not working on web


I am using QuickBlox for integrating video chat in my Java web application. Using Angular / JavaScript on front end.

My issue is I am not able to create a session for the user I have created in QuickBlox through API. However I am able to create a session through JavaScript for the Admin user. I mean the user by which I have created my QuickBlox account.

When I retrieve the user on the Java side from QuickBlox, I get the result below:

HTTP/1.1 200 OK

{"user":"id":24837946,"owner_id":63610,"full_name":"lakshay","email":"lakshay@gym.com","login":"lakshay@gym.com","phone":null,"website":null,"created_at":"2017-03-04T05:36:43Z","updated_at":"2017-03-04T05:36:43Z","last_request_at":null,"external_user_id":null,"facebook_id":null,"twitter_id":null,"blob_id":null,"custom_data":null,"twitter_digits_id":null,"user_tags":null}}

HTTP/1.1 200 OK

{"user":"id":24837064,"owner_id":63610,"full_name":"lakshay","email":"lakshay.gym@gmail.com","login":"lakshay.gym@gmail.com","phone":null,"website":null,"created_at":"2017-03-04T04:53:35Z","updated_at":"2017-03-04T04:53:35Z","last_request_at":null,"external_user_id":null,"facebook_id":null,"twitter_id":null,"blob_id":null,"custom_data":null,"twitter_digits_id":null,"user_tags":null}}

These are my two users in QuickBlox, but I am not able to create a session.

In the JavaScript side, I am sending this in the create session method:

{
    application_id: 50623,
    auth_key: "2Z77VTuccR3XzLf",
    nonce: 439,
    signature: "8648eaeaf2922f4b58e7847159267d60f45dbd04",
    timestamp: 1488626331,
    user: {
        login:"lakshay@gym.com",
        password:"xyz"
    }
}

I am getting the following error in the JS side in the create session method:

object {code: 401, status: "error", message: "Unauthorized", detail: "{"errors":["Unauthorized"]}"}

I am using Starter Plan from QuickBlox.


Solution

  • I finally solved my issue by making following changes..

    While creating session I needed to pass the Admin UserId and password. Which I was using to login into the Quick blox Admin Panel.

    After successful creation of session, I got session token which I passed to connectChat method with the UserId of the user whom I wanted to logged into the chat.