Linked in previews not working - iis

I have searched all over the internet for an answer and although I can find a million people with the same question I cannot find an official solution to the problem im experiencing.
I always get "Cannot display preview. You can post as is, or try another link." displayed.
I've stripped a page down to only the required open graph meta tags so I know they work (run through multiple OG validators), Ive disabled any kind of robots blocking, any kind of redirects, disabled the firewall on a test server, made sure the LinkedIn bot requests are hitting the server. All I see in the browser console all the time is a status 500 being returned from LinkedIn's preview generator API.
We are hosting on Windows Server in IIS 8.5, it seems if I create a demo and host it somewhere else it works, which makes me think it is server related or IIS settings.
Reading this Linkedin post's picture doesn't appear in summary its seems like a similar issue. We are not serving over SSL so nothing to do with that.
I have already asked this question on LinkedIn's forum but having no luck, so im hoping someone on here can help or someone from LinkedIn's tech team can help.
Thanks

So we had this issue as well and it turns out parts of our system that use user generated themes were not adding the "Content-Type" header to the response.
So examine the response headers coming from your server and make absolutely sure they are correct and that they include the correct "Content-Type" (with correct encoding) and "Content-Length".

Related

Can you add url or body parameters to the internal url in Azure application proxy?

I already set up the application proxy and it works fine. The problem is I need to pass info about the Microsoft user to the application that the internal URL is pointing to, and I haven't found a way to change the url dynamically, much less create a custom body, to pass on said information.
If there isn't any way to send said info over url or request body, would it be possible over cookies? If so I'd love it if you could link me to some sources to read up on it as I have no prior experience working with cookies and have absolutely no idea about how they work:\
I'd really appreciate any help you can give me, I googled a bunch and am yet to find an answer. Also please don't crucify me if the answer is obvious lol, I'm trying:(

ASP.NET Core 5 MVC web app returning bad request errors in some pages after deployment to IIS

I have tried everything. I configured Windows Server 2019 according to Microsoft documentation and I successfully deployed a .NET 5 web application to the IIS.
I can get to the login page. I can even get to the forgot password page and they show themselves fine. However when I try to do any action (send the forgot password link or login to the page) I get a "Bad Request" from the server. I haven't found a way to explain why.
I have tried several, and I mean several things found Googling around but nothing helps. This include disabling https within the .NET Core application, trying to get a detailed error page using the app.UseDeveloperExceptionPage(); instruction inside Startup, etc etc but nothing works. I always receive this page trying to execute any action:
If someone could help or point me into the right direction, I will really, REALLY appreciate it.
Thank you
PD: In case it has anything to do with the problem, the error, at least the two that I can reproduce (because I can't even log in), happens, I think (maybe don't) when redirecting to another page in Microsoft Identity.
EDIT: code was asked by one of you. Thank you.
As you see, there's nothing specific in the forgot password screen for my application. This is scaffold code from Microsoft Identity. I even edited it and just let one line of code inside it, which is the default return code anyway as follow:
public async Task<IActionResult> OnPostAsync()
{
return RedirectToPage("./ForgotPasswordConfirmation");
}
As you can see, there's nothing special with that code. Here's the html that calls it, again, is a scaffold of Microsoft Identity with little to no changes (by little, I mean, maybe some CSS and a new value of view data):
But then again, forgot password page actually shows and seems well in the front end, but immediately I try to enter my email and click enter in this page, (also, just a scaffold of Microsoft Identity):
Nothing happens. I receive the bad request. There's NO magic nor custom code here. Something silly is going on.
EDIT II: YES, locally it works perfectly. The strange behavior happens only when deployed to IIS.
EDIT III: I coded and enabled logging in my .NET Core APP and wrote that to a file, and I think I finally got, at least the error (not the reason yet):
But why?? Cookies are enabled in the server browser without avail, same issue. Someone has a better idea than disabling anti forgery rules to login and forgot password pages?
Thank you
For some reason, when I deployed the first version of my app into IIS, I thought it was a good idea to just browse it from the IIS link. Of course, in a new mounted Windows Server 2019, IE is still the default browser. I connected directly to the IP of my web app via VPN, but used Chrome this time. Guess what? All problems disappeared. Yes, it's a bad idea to try to use a modern framework like .NET Core Identity with IE.

Linkedin - Preview image doesn't show

Been going round and round on this one. Not a new issue but struggling to identify exactly why LinkedIn doesn't like my images and everyone else does. Facebook and twitter show ok with it
At first thought might be meta issue or cache issue (am familiar with the clear method) or image requirements stated by LinkedIn but ruled all that out. The ssl is a free one but soon to be using a wildcard as facebook didn't like it to see if that has any effect.
The image server uses node js express to deliver static files.
If I just share the image, that shows an error of: "Cannot display preview. You can post as is, or try another link." which points to the server and image to me instead of the website.
The site and images are on different servers with different setups.
Main url is https://rocketthomerentals.com/property/5-bed-house-to-rent-in-newcastle-under-lyme/102750000371
with the image of
http://media.estateapps.co.uk/487/102750000371_IMG_371_1_large.jpg
Anything else I can try? Should be getting the new wildcard SSL sorted early next week but posting here to see if there is anything else I am missing I can try to see if that has any effect.
Thanks
For anyone who's gone around in circles about this issue, was resolved by defining the content type as image, it was missing from the server config.

Retrieve BLOGS_UPLOADED_IMAGES in java

I have some java code that retrieves blogs through the REST API's. I am not using the social business toolkit, but we have our own framework for that.
The application works perfectly on an on-premise connections environment and has worked on multiple versions.
However when switching to Connections Cloud, some parts stopped worked.
We get a 403 - Forbidden exception on 2 occasions:
Getting the details of a blog post: /blogs/[blog-id]/feed/entry/atom?entryid=[entry-id]
Getting images inside the blog post: /blogs/[blog-id]/resource/BLOGS_UPLOADED_IMAGES/[image file name]
I have fixed issue 1) by switching to the plublishing API: /blogs/[blog-id]/api/entries/[entry-id].
I cannot find a way to fix issue 2). I have also found 2 other image urls:
https://apps.ce.collabserv.com/blogs/[blog-id]/api/media/[file-name]
https://apps.ce.collabserv.com/blogs/[blog-id]/api/media/BLOGS_UPLOADED_IMAGES/[file-name].media
Both return:
<sp_0:error xmlns="http://incubator.apache.org/abdera" xmlns:sp_0="http://incubator.apache.org/abdera">
<code>404</code>
<message>Not Found</message>
</sp_0:error>
I want to authenticate by using Basic Authentication when possible. This does not appear to work with the given 403 urls.
My guess is that this the basic authentication header is not picked up. I have seen this before.
I used to fix this by first calling another URL that does support basic authentication and using the Ltpa cookies to authenticate the image url.
This also does not work: I do get LtpaTokens, but when I pass all the cookies to the URL, the image still does not work.
I prefer not to use OAuth of OAuth 2 at this moment. Is there any other way to fix this?
Anybody else managed to retrieve BLOGS_UPLOADED_IMAGES?
The issue is can also be reproduced in a browser.
Make sure you are not yet authenticated and the blog has posts with
images
Go to /blogs/[blog-id]/api/media
Authenticate using the popup in the browser The Atom feed now appears. This contains the images of your blog.
403 when opening:
/blogs/[blog-id]/resource/BLOGS_UPLOADED_IMAGES/[image]
404 xml when opening: /blogs/[blog-id]/api/media/* links

Google Places Request Returning "REQUEST_DENIED"

I realise their are numerous questions regarding this issue and I have read them all, but I still cannot get this to work!
I have:
Created my project in the API console
Enabled Places API in services
Created a new IOS API Key (repeated this step twice now)
Tried the request with sensor=true, sensor=false and no sensor param at all
Tried HTTP and HTTPS
Those are all the fixes I found within the existing questions regarding this issue, have I missed anything? Here is a sample URL I am using to test:
https://maps.googleapis.com/maps/api/place/textsearch/json?sensor=true&query=Test%20sd&key=MYKEY
And yes, I am replacing 'MYKEY' with my actual API key :).
I am developing an IOS app using monotouch but I don't really see how that is relevant as I can't get this to work in the browser either.
Any help would be hugely appreciated! Been stuck on this all day now.
I believe you want to be using your "Simple API Access" key (not an Android/iOS key). The documentation mentions this as the last step.
https://developers.google.com/places/documentation/#Authentication
I tried your sample URL with my Simple API Access key and it was successful.

Resources