Error 404 on Facebook Callback Url in Azure Bot - facebook

I've created a bot with Bot Framework hosted in Microsoft Azure and It worked fine until yesterday.
From that moment when the bot tries to call the RootDialog, It generates an exception
await Conversation.SendAsync(activity, () => new RootDialog());
The exception message is
Bad Request
in Microsoft.Bot.Connector.MicrosoftAppCredentials.<RefreshTokenAsync>d__26.MoveNext()
If I call my callback url I get an error 404.
Any helps is appreciated.
Thanks
UPDATE
Now, It works again. I wrote to Azure in order to understand why I didn't work for two days.

Related

Flutter : Exception caught by image resource service

HTTP request failed, status Code: 403, when I try to call Map Api in flutter Here is the screenshot
Anyone please help me out
The url shown in your screenshot returns the following message along with the 403 code:
The Google Maps Platform server rejected your request. You must enable Billing on the Google Cloud Project at https://console.cloud.google.com/project/_/billing/enable Learn more at https://developers.google.com/maps/gmp-get-started
You therefore have to do three things, in you code and on the Google cloud console:
Ensure that you trap and report any error message returned from the api in order to better understand the response code.
Cancel the api key that you have now published to the world and generate a new one for the Google maps api, in cloud console.
Enable billing on your project otherwise Google maps api will never work as it is a chargeable service.
Hope this helps. As I said, NEVER publish api keys nor store them on GitHub or similar.
Sorry to say but error 403 means you don't have any access to that image from the server side.

An error occurred while sending the request with PostAsJsonAsync

I have a soap web service which is being consumed by an application. This web service when called from the application posts the data it receives by a call to another web service via POST request using "PostAsJsonAsync". Sometimes the call to the other web service goes through but sometimes it throws an error - "An error occurred while sending the request". There is no specific use case or data scenario when this happens. It just happens at random.
The other service uses a token authentication system. The token is getting generated correctly in every case but the call doesn't go through for some.
Could anyone please guide me what might be the root cause for this issue?
The issue was with certificate validation with request. Resolved by adding this piece of code before making the http post call - ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };

How to send a REST request to Cloud Firestore

I've build an Android app using Firebase, but I'd like to test the performance of the Cloud Firestore using REST requests (through Postman). I've looked up some info on some sites from Firebase, but everytime I send a request, I get a 404 Not Found.
The Authentication I use seems to work, by doing a POST request to
https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyPassword?key=MY_API_KEY I'm able to get a Firebase Id Token.
After that I tried sending a GET request to https://firestore.googleapis.com/v1beta1/parent=projects/MY_PROJECT_ID/databases/(default)/documents/MY_COLLECTION_ID with the token as Authrorization header, but everytime I seem to get 404 Page Not Found.
I'm not sure what I'm doing wrong and I hope someone can help me with this.
Thanks in advance!
Apparently I wasn't supposed to include the parent= in the URL, I removed it and now it works just fine.

Facebook Oauth Servicestack not working

We have been using servicestack as framework for web services, we also uses its SSO with FB, LinkedIn, GooglePlus features.
We enable them like this
Plugins.Add(new AuthFeature(() => new AuthUserSession(),
new IAuthProvider[] {
new FacebookAuthProvider(appSettings),
new GoogleOAuth2Provider(appSettings),
new TwitterAuthProvider(appSettings),
new LinkedInOAuth2Provider(appSettings)}
From 3/27 the FB SSO stops working on our site but the other SSO's like LinkedIn works fine. When I debug for facebook SSO, we are getting the Auth_Code from the FB back to our services, but I am assuming the server to server communication is failing while passing(code, secret). It is just an assumption made as the Auth_token is not set in session. If you came to know that FB updates something in OAuth process that ServiceStack not follows or anything like that, please provide me that info links.
I am wrong in my assumption "we are getting the Auth_Code from the FB back to our services, but I am assuming the server to server communication is failing while passing(code, secret). It is just an assumption made as the Auth_token is not set in session." Using the fiddler I am able to see the server-to-server communication for exchanging Auth_Code, Client_Secret with Access_Token. I see the Token response. After that I was taken back to my ReferralURL. In my Referral end point I am getting the Usersession.ProviderOAuthAccess, It has the Facebook provider but I don't see any Token information in it. This is really an interesting chase. Please help me with any other ideas to test.
I found added info: After getting the Access_Token froom FB, the immediate call is https://avatars.io/facebook/?size=medium initiated by service-stack.
https://github.com/ServiceStack/ServiceStack/blob/v4.0.50/src/ServiceStack/Auth/FacebookAuthProvider.cs
At line 73 of FacebookAuthProvider.cs it calls OnAuthenticated function whoch calls OnAuthenticated function at line 171
https://github.com/ServiceStack/ServiceStack/blob/v4.0.50/src/ServiceStack/Auth/CredentialsAuthProvider.cs
which calls the function SafeAddMetadata at line 177 of the file
https://github.com/ServiceStack/ServiceStack/blob/v4.0.50/src/ServiceStack/Auth/AuthMetadataProvider.cs
Finally triggers this:
"http://avatars.io/facebook/{0}?size=medium".Fmt(tokens.UserName));
Which seems that the tokens.username is empty from my network flow. This issue is beyond my thinking. It used to work, just stopped suddenly not sure what happened, we even don't even upgrade servicestack or servicestack.OAuth packages.

Error code 100 (Can only call this method on valid test users for your app)

getting the error {"error":{"message":"(#100) Can only call this method on valid test users for your app","type":"OAuthException"}} whenever trying to write to any facebook end point. Reading (GET) works fine, writing (POST) fails. Does anybody know how to resolve this?
I have also opened a ticket on FB dev site:
http://developers.facebook.com/bugs/184198634991192?browse=search_4e93328871c8a3231774584
The problem does not occur is I would shoot the POST request from my browser as if I am the user.
The problem does occurs only when sending from our servers on behalf of the user from one of our dev machines which have other subdomain names instead of www (such as dev1.blablabla.com & dev2.blablabla.com, while the app is registered to www.blablabla.com).
So the question is, does facebook attempt to do a reverse DNS lookup on all write requests to verify the source?
I believe your requirement is to get the user details of the owner of Facebook access token (normally the currently logged in user)
For that you have to issue a GET request and not a POST request.
The reason why it works when fired from the browser is that when you submit a query through the address bar it is send as a GET request, and when sent from your server it is send as POST and fails producing the error message mentioned in your post.
Facebook doesn't do a reverse DNS lookup on your write request and not need to configure anything in your server related to it.
Hope the answer is clear enough for you.