10-16-2018 01:36 AM
10-22-2018 02:49 AM
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
10-22-2018 11:22 AM
10-22-2018 11:55 AM
10-22-2018 12:01 PM
10-22-2018 12:17 PM
10-24-2018 01:35 AM
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();
10-24-2018 09:43 AM
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
10-24-2018 10:35 AM
10-24-2018 10:40 AM
10-24-2018 11:25 AM
04-21-2020 05:01 PM
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
04-22-2020 10:29 AM
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
04-22-2020 11:00 AM
04-22-2020 11:31 AM
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
04-23-2020 01:19 PM
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
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide