cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1780
Views
0
Helpful
5
Replies

Problems connecting to SocialMiner BOSH

kgoburn
Level 1
Level 1

Hi all,

In attempting to build a third party gadget for Cisco Finesse, I have successfully written the XML specification for the gadget and embedded it through the 3rdpartygadget account as specified in the Finesse Web Developer Guide. This gadget needs to communicate with the XMPP BOSH server run by Cisco SocialMiner in order to function properly.

Since BOSH is a standard protocol, I am following the guide found here. However, whenever I get to the authentication stage, I fail to get a successful reply from the server. I am somewhat confident that the API calls are being made correctly because upon inspecting the calls being made by a built-in gadget, the makeup of the calls are identical, right down to the credentials.

The following is a rundown of the process used to connect, where these are ajax calls made in JavaScript code:

1. Send a post request to the server as follows:

<body xmlns="http://jabber.org/protocol/httpbind"  

           xml:lang="en-US"  

           xmlns:xmpp="urn:xmpp:xbosh"  

           hold="1"  

           ver="1.9"  

           to="{valid_url}"   

           wait="30"  

           xmpp:version="1.0"  

           from="{agent_name}@{valid_url}"  

           rid="3516575067" /> 

    With the response being:

<body wait="30"  

        inactivity="60"  

        polling="5"  

        requests="4"  

        hold="1"  

        sid="d0a49ad6"  

        authid="d0a49ad6"  

        xmlns="http://jabber.org/protocol/httpbind"  

        xmlns:stream="http://etherx.jabber.org/streams"  

        secure="true"  

        ack="3516575067"  

        maxpause="300"  

        ver="1.6"> 

    <stream:features> 

        <mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"> 

            <mechanism>PLAIN</mechanism> 

        </mechanisms> 

        <compression xmlns="http://jabber.org/features/compress"> 

            <method>zlib</method> 

        </compression> 

        <bind xmlns="urn:ietf:params:xml:ns:xmpp-bind" /> 

        <session xmlns="urn:ietf:params:xml:ns:xmpp-session" /> 

    </stream:features> 

</body> 

2. Send a post request to the server for auth

    ​​

<body xmlns="http://jabber.org/protocol/httpbind" sid="d0a49ad6" rid="3516575068"> 

    <auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="PLAIN">{base64_encoded_auth_string} 

    </auth> 

</body> 

    With the response being:

<body xmlns="http://jabber.org/protocol/httpbind"> 

     <failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><not-authorized></not-authorized></failure> 

</body> 

   

    However, the response to the built-in gadget is:

    ​

<body xmlns='http://jabber.org/protocol/httpbind'> 

     <success xmlns="urn:ietf:params:xml:ns:xmpp-sasl" /> 

</body> 

P.S. I am aware that the proper format for the source for the {base64_encoded_auth_string} is "\u{0}" + username + "\u{0}" + password.

So the issue is, I don't understand what the built-in gadget is doing that I am not doing. I have not been able to get the proper response from the server and these are the main places I have searched to help solve the issue:

Finesse Web Services Developer Guide (11.5)​

SocialMiner Developer Guide (11.5)​

XEP-0206: XMPP Over BOSH

As well as tried to use the libraries:

Finesse JS library

Cisco AJAX XMPP library​

Plain jQuery ajax

xmpp4js

strophe

All to no avail.

Has anyone done this before and can you please help shed some light on the issue?

5 Replies 5

dekwan
Cisco Employee
Cisco Employee

Hi Kenroy,

That is a very good question as this is a very valid use case. Unfortunately I haven't tried this myself, so I don't have any first hand experience. It seems like you have tried a lot of the options I would have tried too. I'll try to look into this when I get a chance, but hopefully someone in this community have tried it before.

Thanx,

Denise

Thanks for your reply Denise. I certainly hope somebody here has done this before and I would tremendously appreciate if you were able to take a look at it as well.

disen
Cisco Employee
Cisco Employee

When SocialMiner posts the social contact notification(resulting from an incoming chat request) to UCCX (via HTTP POST notification), a unique authentication token string is sent with

the message body. This corresponds to the integrationAuthTokenGUID of a SocialContact.

This integrationAuthTokenGUID token is used by the chat gadget as the username to log into the SocialMiner XMPP server to enter the chat room with the agent.So, in the request

below,

<body xmlns="http://jabber.org/protocol/httpbind" sid="d0a49ad6" rid="3516575068">   

    <auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="PLAIN">{base64_encoded_auth_string}   

    </auth>   

</body>

the {base64_encoded_auth_string} is nothing but the integrationAuthTokenGUID of the SocialContact and not the SocialMiner/Finesse username/password.

If it is valid SocialMiner would accept the credentials allowing the reply template to log into the XMPP server.

Are you sure, you are using this integrationAuthTokenGUID as part of your authentication request ?

DIbakar Sen, I haven't gotten that far I don't think. I believe that in order to receive the social contact notification in UCCX that you refer to above, I would already have to be subscribed to the XMPP server. When analyzing the network logs generated by the existing gadget, the HTTP POST calls with the XML payloads that I showed in my original post occur as soon as the agent logs in to the Finesse desktop.


The {base64_encoded_auth_string} that is included in the second POST request from that gadget is the same string every time and when I decoded it, it turns out to be "\u{0}" + username + "\u{0}" + password, where username and password are those of the current agent. Similarly, when I composed a string of the form \u{0}" + username + "\u{0}" + password myself and base64 encode it, it results in the very same {base64_encoded_auth_string} passed by the existing gadget. These tests are what make me fairly confident that I'm emulating the calls identically. What I'm wondering is if the gadget is doing something behind the scenes that isn't exposed.


So, in response, the {base64_encoded_auth_string} isn't the integrationAuthTokenGUID, I haven't come into contact with that yet as the network logs I have analyzed don't include the receipt of an incoming chat request.

You want to connect to the SocialMiner Xmpp server so that the agent can receive and send messages back and forth from your custom gadget to the chat room for a chat.

The specific room id to join to will be in the social contact corresponding to a chat. So, your gadget must have received a SocialContact in the first place. Is that the case already ?

I am trying to understand what elements are missing in this overall data flow.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: