Facebook sharer and prerender.io (in an angularjs app) - javascript

I've just setup prerender.io middlewave into my tomcat server (running some java webservices and an angularjs app).
The service (prerender) works as it should and I can see the pages adding to the list (also when I send a request simulation the user agent).
My problem is with the Facebook share button (from addthis).
Basically if I visit a not yet cached page and click the "Share on Facebook" button, it will show me the angularjs template and not the "rendered" one.
The strange thing is that I then can see the page on Prerender.io admin.
It's like it's too slow and it times out. Still I don't know how it get the non-cached version of the page.
After the first wrong call Facebook caches the page so if I don't manually refresh it from the Facebook Object Debugger (https://developers.facebook.com/tools/debug/og/object) the wrong page will stay cached on FB servers until the FB cache is refreshed.
Anyway has any suggestion on how to fix this?
I could pre-cache every page but I will have to deal with new pages and I don't think it's a nice solution.
thanks,
Dem

I have the same issue and it still bothers me a lot.
What you can do is after you create your page (typically your user save something), then you can create a server call to prerender to recache your page. After some time (for example 1 min) you can invoke an another call to facebook to refresh its cache...
The only issue with this, it works only after couple of minutes... :(

Related

Refresh redirects to homepage on live server using dynamic routing of next.js

I am new to next.js and I am using dynamic routing in one of my project. Everything works fine on local host. When I open the dynamic page it opens up alright, and on refresh the same page appears again after loading up. But when I am hosting it on live domain, then although the page opens up fine, but on refresh it redirects to homepage as if it doesn't recognize the url.
Below is the api call in the dynamic route page.
Page Structure
API call in [pid].js
The call to the dynamic page:
I have also tried using getServerSideProps but same issue.
Since this is my first time asking a question at stack overflow so I might have missed some detail. Anyways, any help regarding this matter would be tremondously appreciated.
I think that I have tried almost everything, I just want the dynamic route to render correctly on refresh on live server but I can't seem to find any solution.

Peoplesoft screens in an iFrame

Has anyone successfully integrated Peoplesoft screens or navigation via an iFrame in a third party app like Liferay or uPortal?
We are trying to integrate Liferay Portal as a web front end and consume some of the PeopleSoft screens in an iFrame portlet. Both the Liferay Portal and Peoplsoft systems are on different top level domains. We are using Oracle Single Sign On on bot the applications. We have a couple of issues with this.
The screens display in the iFrame - however, the JavaScript on the PeopleSoft does not execute and keeps spinning. In Chrome devtools console, there is the following error:
Uncaught TypeError: Cannot read property 'getStoredData' of undefinedPT_PAGESCRIPT_win0_MIN_1.jsp
If not already signed in to the PeopleSoft system via SSO - the Login page pops out of the iFrame on IE browsers. To clarify based on comments below, the SSO happens for the first app like Liferay, however the user didnot try to go the second app PeopleSoft yet. So the SSO cookies for the second app (PeopleSoft) are not yet in the session. So when we access the page with the iFrame containing the Peoplesoft page, it pops out of the frame in IE trying to establish SSO session and cookies with PeopleSoft.
Has anyone been able to solve any of these issues?
Any insight would be much appreciated. I can provide more details if needed.
Thanks!
Edited for clarification based on comments below.
We have been able to resolve the above 2 issues.
First, we created a new instance of the portal in the same parent domain as the PeopleSoft domain and ensured both were using SSL so the protocol matched. This resolved the cross domain JS errors
Second, we changed our Oracle IdM SSO login flow to always redirect to a new PeopleSoft PIA which redirects back to Liferay's original URL. This ensures there is a valid PeopleSoft session and prevents iFrame popouts along with other integration issues. There is a lot of changes and work done by our team on this around related use cases(deep links, session timeouts) and flows. I'd be happy to post more details if anyone is proceeding down the same path.
Thanks for all the comments which helped us dig in the right direction. We also got feedback from other Liferay and PeoplesSoft customers who followed similar approaches.

Issue with editing of Path authentication page

So I have next issue. My app export some images to Path(some social network, as I think), and I use Amazon appstore for sharing my app. But the authentication page of Path, which I fetch in webview has a link to Apple Store and Google Play Market, that's very bad, because of amazon policy disallows such links and I can't publish my app. Here is example of such authentication page - https://partner.path.com/oauth2/authenticate?response_type=code&client_id=1b81bf92642176a90222d90c5ca5c2c6937f4dd7.
First of all, I tried to find some way to edit downloaded page - use javascript to get code of page, delete a link and fetch it back to webview. But after such manipulations webview stop to respond on clicks and I can't log in. I done smth like in this post - Is it possible to get the HTML code from WebView.
So I ask your help guys in next issue - I need working variant of authentication page of Path without any links to any markets.
everybody! It's not possible to edit the page in way it will working correctly after it. So I was forced to delete this function from my app.
Also I have written an email to Path team - they just answered that they don't going to change their authentication page in near future.

Hiding URLs from the location bar

This might be a silly question which I'll delete if I realise, so if you are reading this then I didn't yet figure it out.
I have some software which is online (addressable) and available but it's a bit of a secret, so instead of just hitting my software when you come to my domain, you are shown a blog that I wrote and hidden within that blog is a link ;)
All well and good.
Now the problem is that users of my software always post screenshots which gives my 1/2 secret URL away. EEEEK yep! So I wanted to have the url be just the plain old normal domain, so as not to make things too easy for them hacky types :p
I have full control over everything here. Clientside / Server / Everything. Initially you hit some jsp and then the GWT app (inside of Tomcat) - you have to provide login details in the GWT app. So I have plenty of places to do this URL hiding / faking but any ideas to help would be great.
...and yes I'm posting this (perhaps isn't too dumb)!
Many thanks in advance.
You can use the javascript history.pushState() here
history.pushState({},"Some title here","/")
For example, on http://yourwebsite.com/secretlink.html, after the JS runs, the URL bar will show http://yourwebsite.com/ without having refreshed the page1. Note that if the user refreshes the page they will be taken to http://yourwebsite.com/ and not back to the secret link.
You can also do something like history.pushState({},"Some title here","/hidden.jsp"), so that if the user refreshes the page you can show them an error page that tells them to find the secret link and open it again.
1. If you pushState() some other domain than your own, a refresh will happen so this cannot be abused to phish sites
Include the inner page as an iFrame

Website FB login redirects to blank page

I'm getting a blank permissions page on facebook login using the Javascript SDK. It was working for the last few days and I'm not sure what I changed. I don't seem to be using my app secret anywhere (I do define the API key). Are there any suggestions for troubleshooting? The Facebook debug page unfortunately just had me add some meta tags related to open graph which didn't change anything. I've tried looking at the 100s of other questions like this but can't figure it out. I tried reverting to an older version of my code so I'm pretty sure it's something with the Facebook, but it was working.
The blank page is in the popup window and has something about permissions in the URL. My site doesn't require any permissions though.
This is the URL in the login window after signing in:
https://www.facebook.com/dialog/permissions.request?_path=permissions.request&app_id=number_I_removed&redirect_uri=http%3A%2F%2Fstatic.ak.facebook.com%2Fconnect%2Fxd_arbiter.php%3Fversion%3D11%23cb%3Df8917d1784b726%26origin%3Dhttp%253A%252F%252Fpostacle.com%252Ffd565a0d8d775e%26domain%3Dpostacle.com%26relation%3Dopener%26frame%3Df12565ffe5570f2&sdk=joey&display=popup&response_type=token%2Csigned_request&domain=postacle.com&fbconnect=1&from_login=1&client_id=number_I_removed
If I reload my page I'm signed in correctly. The app ID and Client ID are the same in the URL. Not sure if they should be but wasn't specified a client ID or means of generating one.
OK, so of course I left out a critical detail: I'm using Django. Further, I'm so reliant on Django I was serving my Facebook channelUrl in a view. Facebook's API didn't like that. After reading the story of a similarly cursed fellow, I changed my ways: URL links directly to channel.html file. No more sorrows.

Categories

Resources