cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
8582
Views
0
Helpful
29
Replies

webex teams gadget

ravi.kumar1
Level 1
Level 1

 

System version: 10.6.1.11002-15
i have downloaded the gadget from below link
 
 
followed the instructions and when i send a message using the gadget i get the below error and as u can see it is not loading the gadget properly.
 
I get the Cisco webex authentication page before this and am able to authenticate successfully.
 
webex.JPG
 
 
29 Replies 29

and on 17th i was getting the token successfully

 

2018-10-17T13:57:53.424 +05:30: 1B2CEC: eipsccxsa01.broadridge.net: Oct 17 2018 04:27:53.489 -0400: WebexTeamsTeamAnnouncementsGadget : _postData(): An error occurred while sending the messages to the room.
concat:15477:17
2018-10-17T13:57:54.353 +05:30: 1B2CEC: eipsccxsa01.broadridge.net: Oct 17 2018 04:27:54.418 -0400: Header : [ClientServices] MasterPublisher._parseAndPublishJSONEvent() - Received JSON event on node 'cuic-58020-desktop': {"ROWS":[{"id":"LakkarajuR","operation":"UPDATE","VoiceCSQDetailsStats":{"agentId":"LakkarajuR","agentName":"Ramu Lakkaraju","agentState":"Not Ready","skillGroup":"","agentStateDuration":548347,"reasonCode":200,"AgentVoiceCSQNames":[{"agentVoiceCSQName":"Edgewood Mainframe"}]}},{"id":"TippireddyN","operation":"UPDATE","VoiceCSQDetailsStats":{"agentId":"TippireddyN","agentName":"NagaLakshmi Tippireddy","agentState":"Ready","skillGroup":"","agentStateDuration":6394794,"reasonCode":0,"AgentVoiceCSQNames":[{"agentVoiceCSQName":"Edgewood Mainframe"}]}},{"id":"58020","operation":"UPDATE","VoiceCSQDetailsStats":{"agentId":"58020","agentName":"Ravi Kumar","agentState":"Not Ready","skillGroup":"","agentStateDuration":285166,"reasonCode":32760,"AgentVoiceCSQNames":[{"agentVoice…
finesse.js:15420:17
2018-10-17T13:57:54.778 +05:30: 1B2CEC: eipsccxsa01.broadridge.net: Oct 17 2018 04:27:54.843 -0400: WebexTeamsTeamAnnouncementsGadget : _updateGadget(): Webex Teams Room Id: Webex Teams Team Announcements
concat:15477:17
2018-10-17T13:57:54.779 +05:30: 1B2CEC: eipsccxsa01.broadridge.net: Oct 17 2018 04:27:54.844 -0400: WebexTeamsTeamAnnouncementsGadget : _getAccessToken(): Getting the access token
concat:15477:17
2018-10-17T13:57:54.780 +05:30: 1B2CEC: eipsccxsa01.broadridge.net: Oct 17 2018 04:27:54.845 -0400: WebexTeamsTeamAnnouncementsGadget : _getAccessToken(): Successfully retrieved the access token

That was the wrong room id though:
2018-10-17T13:57:54.778 +05:30: 1B2CEC: eipsccxsa01.broadridge.net: Oct 17 2018 04:27:54.843 -0400: WebexTeamsTeamAnnouncementsGadget : _updateGadget(): Webex Teams Room Id: Webex Teams Team Announcements
concat:15477:17
2018-10-17T13:57:54.779 +05:30: 1B2CEC: eipsccxsa01.broadridge.net: Oct 17 2018 04:27:54.844 -0400: WebexTeamsTeamAnnouncementsGadget : _getAccessToken(): Getting the access token
concat:15477:17
2018-10-17T13:57:54.780 +05:30: 1B2CEC: eipsccxsa01.broadridge.net: Oct 17 2018 04:27:54.845 -0400: WebexTeamsTeamAnnouncementsGadget : _getAccessToken(): Successfully retrieved the access token

I am just brainstorming because I don't have a solution for you right now.
- If you go to https://eipsccxsa01.broadridge.net:8445/3rdpartygadget/files/WebexTeamsTeamAnnouncements/oauth.html, do you see "Authenticating...". I want to make sure that the oauth page is able to be loaded successfully.
- Have you tried to clear your cache to make sure it is loading the latest gadget
- Do you see any errors in the browser console after you accept the integration?

Thanx,
Denise

Yes i do see 'Authenticating'

Yes i have to actually clear the cache everytime i make a change in the files so yes I've tried that plenty of times.

Ok, I would recommend modifying the oauth.html to have some alerts or console logs to see where it is going.

In the AJAX call, add an error callback function to see if it is going in there instead. I would also recommend adding some logging in the success callback to see if it is being stuck in there.

Also, look at the cookies on the browser and see if there is any value for spark_access_token.

seems like it is going to the else portion of the below code

 

     * Get the access token from the cookie that was set by the
     * OAuth. Return true if a token is found. False otherwise.
     */
    _getAccessToken = function () {
        clientLogs.log("_getAccessToken(): Getting the access token");

        // Get the access token from the cookie that was set by the oauth
        var value = "; " + document.cookie;
        var parts = value.split("; " + "spark_access_token" + "=");
        if (parts.length == 2) gadgetParams.token = parts.pop().split(";").shift();

        // Return true if found. False otherwise.
        if(gadgetParams.token) {
            clientLogs.log("_getAccessToken(): Successfully retrieved the access token");
            return true;
        } else {
            clientLogs.log("_getAccessToken(): Unable to retrieve the access token");
            return false;
        }
    },

 

below is the portion of oauth.html from where it gets the access token

 

if (hash[0] == "code") {
                        $.ajax({
                            url: 'https://api.ciscospark.com/v1/access_token',
                            type: "post",
                            headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
                            data: "grant_type=authorization_code&client_id=" + OAuthClientId + "&client_secret=" + OAuthClientSecret + "&redirect_uri=" + encodeURI(redirectURI) + "&code=" + hash[1],
                            success: function(data) {
                                var cookieName = 'spark_access_token';
                                var cookieValue = data.access_token;
                                var myDate = new Date();
                                myDate.setMonth(myDate.getMonth() + 1);
                                document.cookie = cookieName +"=" + cookieValue + ";domain=." + finesseDomain + ";path=/";
                                window.close();

Hi,

 

I was referring to modifying the oauth.html:

$.ajax({
    url: 'https://api.ciscospark.com/v1/access_token',
    type: "post",
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
    data: "grant_type=authorization_code&client_id=" + OAuthClientId + "&client_secret=" + OAuthClientSecret + "&redirect_uri=" + encodeURI(redirectURI) + "&code=" + hash[1], 
    success: function(data) {
        var cookieName = 'spark_access_token';
        var cookieValue = data.access_token;
        var myDate = new Date();
        myDate.setMonth(myDate.getMonth() + 1);
        document.cookie = cookieName +"=" + cookieValue + ";domain=." + finesseDomain + ";path=/";
        window.close();
    }
});

Add an error clause to the ajax call and see if it is going in there instead of the success. Also add logging to both to see what path is being taken.

 

Thanx,

Denise

Error clause, you mean like an alert message?

I mean an error callback similar to the success one. You can put an alert message in there if you want. Some sort of logging to let you know if the ajax call is going to the success or error.

Ok thanks. I'll report to you tomorrow.

Hi,

I download the WebexTeamsTeamAnnouncementsSampleGadget-Finesse-11.0.1-v2.0 from GitHub. 

 

First, I login to developer website and execute the following steps:

1. Create Integration and configure the steps in the WebexTeamsTeamAnnouncementSampleGadget.pdf file.

2. Modified the oauth.html and WebexTeamsTeamAnnouncementSampleGadget.js files. Adding the domain and Oauth Authrization URL from the step 1.

3. Created a room and save the room "id".

4. Deployed all the custom gadget files + oauth.html to the Finesse server 12.5.

5. Open browser and able to access the oauth.html and WebexTeamsTeamAnnouncementSampleGadget.xml files.

6. Configure the WebexTeamsTeamAnnouncementSampleGadget in the desktop layout.

7. Closed all browsers.

8. Login in as agent -- good.

9. After a few seconds. I got a prompt to "Accept" or not. I accept.

10. I takes me to a login web page. I entered user id and password.

11. It is stuck in the oauth.html file. I look at thedebug console and I see the error below:

"Failed to load resource: the server responded with a status of 404 ()".  I copy from console.

api.ciscospark.com/v1/access_token:1 Failed to load resource: the server responded with a status of 400 (Bad Request)

12. I modified oauth.html file and added in error function to capture the error.

13. Closed all browser.

14. Open browser and login in as an agent again.

15. It prompt me for email id and password.

16. Got the message "Authenticating..".

17. Click on debug console.

18. Capture the error:

POST failed: HTTP/1.1 400 Bad Request (url = https…provided does not match a pre-registered value.')

"POST failed: HTTP/1.1 400 Bad Request (url = https://idbroker.webex.com/idb/oauth2/v1/access_token, request/response TrackingId = ROUTER_5E9F8769-C5E0-01BB-010A-46777F01010A, error = '(redirect_uri_mismatch) The redirection URI provided does not match a pre-registered value.')"

{"message":"POST failed: HTTP/1.1 400 Bad Request (url = https://idbroker.webex.com/idb/oauth2/v1/access_token, request/response TrackingId = ROUTER_5E9F8769-C5E0-01BB-010A-46777F01010A, error =

 

When I click on the error line in the oautht.html file. I cannot see the html file content.

 

Does the WebexTeamsTeamAnnouncements run on Finesse 12.5 and support oauth2?

 

Thanks.

 

Danny

 

 

 

 

 

 

Hi,

 

I was able to reproduce the issue. The reason for the issue is because we had to restrict the network access out from the sandboxes so unfortunately, it is unable to access the api.ciscospark.com site. I will let the sandbox folks know, but I do not know how long it would take for them to add that access or if they would even do it.

 

Thanx,

Denise

Thanks for getting back to me.

So, there is no way I can get the access token?

I am trying out another Cisco developer tutorial about getting the access token. Very small project only one html file. I find it very useful.

https://developer.cisco.com/learning/lab/collab-spark-auth/step/2
https://github.com/CiscoDevNet/webex-teams-auth-sample

I would assume it will have the same issue.

Hi,

 

For the Finesse sandbox environment there is no way. It is basically a network restriction issue on the sandbox environment which doesn't allow it to access the link to do the oauth handshake.

 

For the lab link you provided, that isn't in the sandbox environment so it should work fine. 

 

Thanx,

Denise

 

Hello Danny,

On the scenario that you listed in that you cant get access to the URL for generating the token, due to the sandbox Firewall, can you confirm if you are placing the call from your laptop VPNed to the sandbox pod OR placing the api call from an server in the sandbox pod(like the ad server for example).

Thanks 

Eddie