Graph Toolkit React People Picker Error in console for User Photo Endpoint - azure-ad-graph-api

I am using Microsoft Graph Toolkit to add people picker to my REACT application. The people picker functionality is working but on the browser console it is logging error for the use photo API. Since the code behind the component is abstract, not sure what really is happening.Anybody faced this issue or any clue on why the error on console?
Error on console is below "HTTPMessageHandler.ts:31 GET https://graph.microsoft.com/v1.0/users/Otayeb#isdbdev.org/photo/$value 404 (Not Found)". As you can see it is trying to get the photo of the user from the graph endpoint and the dynamic value is not populated.
export default function NormalPP(){
Providers.globalProvider = new MsalProvider({
clientId: '8a17f110-fe17-4594-9463-ffc39da24b9c'
});
return(
<div className="App">
<header>
<Login />
</header>
<PeoplePicker/>
</div>
)
}

This error will be posted in the browser console if the user loaded to the people picker does not have their photo updated in their Office 365/Azure profile.

Related

IBM's Watson Assistant has stopped responding

Just over a year ago I created a chatbot using IBM Watson Assistant. It is successfully interfacing with wordpress and facebook. it was working perfectly well in a web page too, but has now stopped outputting any text. I created the website integration by copying the code shown in the "preview link" page created by IBM when the bot is under development. That code includes a library file called "chat.0.0.4.js" and corresponding css. When the code runs now, the chatbot renders correctly, but when I look at the browser console I see at line 12990 in chat.0.0.4.js:
400 - {"error":"Invalid Request Body","errors":[{"message":"When source.type is not 'watson', source.id is required
Does anyone know how to fix this? I see that the integration code from the "preview link" is now totally different and I wonder if the mechanism I used a year ago is now depreciated?
Thanks.
I think you need to use the newer version, the script to integrate WA has changed and now looks like this:
<script>
window.watsonAssistantChatOptions = {
integrationID: 'YOUR_INTEGRATION_ID',
region: 'YOUR_REGION',
serviceInstanceID: 'YOUR_SERVICE_INSTANCE',
onLoad: function(instance) {
instance.updateUserID(L12345);
instance.render();
}
};
setTimeout(function(){
const t=document.createElement('script');
t.src="https://web-chat.global.assistant.watson.appdomain.cloud/loadWatsonAssistantChat.js";
document.head.appendChild(t);
});
</script>

Getting "Forbidden Error 403" on Google Calendar(s) using Zend_Gdata_Calendar()

I have an embedded script running on the home page of one of my sites that pulls a selected list of events on our Google Calendars and lists them on the page. I have been running this script, without change or revision, since about 2011.
Yesterday (maybe the day before) the script started throwing an error Forbidden Error 403.
Here is a snippet of the script:
$ctz = 'America/Los_Angeles';
$calendarID[] = 'example.com_abcdefghijklmnop1234567890#group.calendar.google.com'; //Dept 1 Events
$calendarID[] = 'example.com_klmnopqrstuvwxyz0987654321#group.calendar.google.com'; //Dept 2 Events
/*...*/
$eventArray = buildEventList($calendarID, $ctz);
function buildEventList($calendarID=NULL,$ctz=NULL) {
require_once('Zend/Loader.php');
Zend_Loader::loadClass('Zend_Gdata');
Zend_Loader::loadClass('Zend_Gdata_Calendar');
Zend_Loader::loadClass('Zend_Uri_Http');
$gdataCal = new Zend_Gdata_Calendar();
$query = $gdataCal->newEventQuery();
try {
/*...*/
}
catch (Zend_Gdata_App_Exception $e) {
$return = $e->getMessage();
}
return $return;
}
The following error message is showing as a result of the catch{}:
Expected response code 200, got 403
<HTML>
<HEAD>
<TITLE>Forbidden</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Forbidden</H1>
<H2>Error 403</H2>
</BODY>
</HTML>
Any ideas on why this started happening or how to resolve?
Notes:
I logged into each of my Google Calendars and nothing on their settings have changed. They are still shared publicly and the ID's have not changed -- I verified everything inside Google Account.
Learnings through continued research:
I think I may need a Google Developer Key -- (1) not sure how to get one and (2) continuing to research.
Since November 17 you can't use google API V1 or API V2 anymore. Zend Gdata use google API V2. So, you can't use zend anymore to get events. You have to use google library or use your own class. You can see an example of google api V3 class without google library: Authentification Zend Gdata (403 forbidden)

how to send and receive data between phonegap child browser to main application

I'm working on a Facebook login authentication in a Phonegap child browser. For that externally I have a page that can initiate authentication process and redirects back after authentication (let's say www.mysite.com/Facebook.html). Now I have authentic user from Facebook, but how can I get that authentic user data from child browser to main application and close child browser. for security reason, I set "showLocationBar: false" , so there is no close button.
So, now let me know
how can I get Facebook authenticated user data (user email and access token for further transactions with Facebook) to main application and close child browser.
how to close child browser from child browser as I don't have close button on Child-browser.
is there any way to save data from Facebook to a JavaScript object in my main application
This is my first application with Phonegap, but im experienced with Facebook and JavaScript. So , please let me know if I'm wrong any where.
Thanks in advance,
Looking forward.
I am also using chilldbrowser for Facebook connect. Here is the link for complete source code for Facebook connect using childbrowser: http://www.drewdahlman.com/meusLabs/?p=88. You can get user's name using access_token using the code below:
var params='access_token='+accessToken;
$.get("https://graph.facebook.com/me",params,
function(response){
fbUesrName=response.name;
},"json");
You can close the childbrowser using:
window.plugins.childBrowser.close();
#Venkat : Not sure if you already got the answer for closing child browser from within app. This code worked for me. Put a close button on your site and put the URL as "google.com".From PG app you can write the code below
window.plugins.childBrowser.onLocationChange = function(locationLink){
if (locationLink.indexOf('google.com') > 0) {
window.plugins.childBrowser.close();
}
}

Passing Parameters from e-mail link to jQuery mobile web app

I created a web app using jquery mobile 1.1.1
As part of my app I built password retrieval functionality. If a user needs to reset their password, they fill out a form and receive an e-mail with a link that includes the address of the password reset page and two other parameters as such:
www.mywebapp.com/demo.html#resetPassword?x=123&y=123
The Initial Problem:
When the user clicks on the link, they see the home page of the web app even though the URL in the address bar says: www.mywebapp.com/demo.html#resetPassword?x=123&y=123 I understand that jQuery mobile does not support passing parameters after the hash, so I came up with the following solution.
A Solution with a small inconvenience:
I put together the following code, which reads the URL, captures my two parameters and redirects the user to the password reset page:
$( document ).bind( "pagebeforeshow", function() {
//cpe("parameter") will check whether the specified URL parameter exists
if(cpe("x") && cpe("y")){
//gpv("parameter") captures the value of the specified URL parameter
recovery.username=gpv("x");
recovery.token=gpv("y");
$.mobile.changePage("#resetPassword");
}
})
The Inconvenience, and thus my current problem:
When the user clicks on the link in the e-mail the browser fires up and opens the main page of the app, and then it quickly displays the #resetPassword page. I understand that this happens because I'm changing the page
$.mobile.changePage("#resetPassword");
But, how do I modify the above code so that the user won't see the main page at all, and go straight to the #resetPassword page?
Use an empty initial page with no content. By default do a changePage to what was your initial page, but in other cases, like the resetPassword case, you changePage to that instead.
I followed Raymond Camden's suggestion and added the following to my html:
<pre>
<!--Start of blank initial page: #initPage-->
<div data-role="page" id="initPage">
<div data-role="content"></div>
</div>
<!-- /page -->
</pre>
I also added the following to my javascript:
//init page -> path control hub
$( document ).bind( "pagebeforeshow", function() {
var pageid=$.mobile.activePage.attr('id');
if(pageid=="initPage"){
if(cpe("x") && cpe("y")){
recovery.username=gpv("x");
recovery.token=gpv("y");
$.mobile.changePage("#resetPassword");
}else{
$.mobile.changePage("#info");
}
}
})
It's working now.

strange error with Facebook Feed dialog

We followed the Facebook example code, shown here -- this works in our app -- if you click the anchor 'a' link, its onclick handler opens a new window and the facebook feed dialog appears:
<a class="fbShareToWall" onClick='window.open("https://www.facebook.com/dialog/feed?app_id=123050457758177
&link=https://developers.facebook.com/docs/reference/dialogs/
&picture=http://fbrell.com/f8.jpg
&name=Facebook%20Dialogs&caption=Reference%20Documentation
&description=Using%20Dialogs%20to%20interact%20with%20users.
&redirect_uri=http://www.example.com/response");'>Share on Facebook</a>
The above code works fine and displays the Facebook sample of the Feed dialog.
Here is our code - we get the error message:
"An error occurred with oursite.com. Please try again later.
API Error Code: 191
API Error Description: The specified URL is not owned by the application
Error Message: redirect_uri is not owned by the application.
NOTE: this is a beta site and we're running it on a staging server whose domain name is NOT the same as the domain name that "OUR_APP_ID" below is associated with:
<a class="fbShareToWall" onClick='window.open("https://www.facebook.com/dialog/feed?app_id="OUR_APP_ID"
&link=https://www.oursite.com&name=Please%20work
&caption=Just%20work
&description=Comeon%20work
&redirect_uri=http://www.oursite.com");'>Share on Facebook</a>
(note: our code has the numerical FB app_id, not "OUR_APP_ID")
"OUR_APP_ID" is 'connected' to our production server's domain name and we're kinda wondering if that's the problem.
EDIT: "we're kinda wondering if that's the problem" because the code above is on our staging website www.foo.com --
and our code above uses an app_Id that we connected to our production domain name 'www.oursite.com'.
We wonder if Facebook -- upon receiving the above request to display the Feed dialog -- is saying to itself
"okay this website www.foo.com is trying to display a Feed dialog -- but the app_id is for www.oursite.com --
so we're going to pop up a 191 error"
We tested that theory. We altered the sample FB feed dialog code at the top -- we changed some numbers in the sample code's app id.
And we get an error message now with the formerly working sample Feed dialog code but it is a completely different error message.
Any advice on this '191' redirect_uri error message?
the url format works fine with my app
https://www.facebook.com/dialog/feed?app_id=135669679827333&link=https://anotherfeed.com&name=testing&caption=Just%20testing&description=the%20test&redirect_uri=http://anotherfeed.com
check to make sure your app id is correct and that your redirecting to the domain that is set up in your app settings.