Liferay webconten edit form don't have back link - liferay-6

I deploying a liferay 6.1 server. In my localhost server(for test), I went to controlpanel => webcontent => select a web content => choose 'edit'. It showed a edit form with a 'back' link at the header. And when I clicked 'publish' button or 'back' link, it redirected to the previous link. But in my real server, the edit form had no back link at the header. And when I clicked 'publish' button, it didn't redirect me to the previous page. So what are the differences between my test localhost and my real server? Configuration or error?
Thanks!

I had the same problem.
In my case the name of the virutal host was not correct.
Try this:
Go to Control Panel - Portalsettings - General
Check the field Virtual Host (This field is required!)
Hope this helps.

Related

Logout functionality in OutSystems

I am working on web app in OutSystems 10.0. In the application, if I log out, it logs off. But when I click the browser back Button, it redirects to the Previous page (which should be displayed only after login). Any suggestions?
You probably need to have roles on the pages, if the pages have the role anonymous anyone can open it.
You're probably accessing the website via http and not https, so when you press back on the browser it will show you a cached version of the previous page.
Because it's the cached version, the session and roles are not checked.
As a recommendation, force the https protocol.
Following the link provided by #Abdulhakeem, they recommend the following:
Add a hidden input to the page - initialize it to some value (for example 'no') - so when the page is rendered by the server it always has a 'no'
Add a bit of Javascript to the page ready event to:
Check that value - if it's not what you'd expect from the server (in our case, <> 'no'), force refresh the page (see below)
If it is still set to what you'd expect from the server, change it (in our case to 'yes') and do nothing else
I recommend downloading the .oml provided in the post and reviewing how they actually implemented it.
if you can change to https, you can also in every action that is on the page that do changes on the database. check if you have permissions or you are logged. that way if the person tries to do back and do some action you can redirect it somewhere.

Facebook app domain name when using localhost

From a tutorial here:
http://ankurm.com/blog/api/using-localhost-for-facebook-app-development/1091/
I tried to set up a Local development Area for my Facebook app. But when I put "http://localhost:85/my_app/" as my domain name, Facebook says
App Domains: "http://localhost:85/app-name/" should not contain protocol information.
Also when I put "localhost:85/my_app/" as my domain name, I get the error:
App Domains: localhost:85/my_app/ is not a valid domain.
It seems like the protocol has been changed.
Here is my solution (I tested on 3rd April 2015 and it works well):
In Settings -> Basic tab
App Domain: localhost
Click "+Add Platform" and choose "Website"
Site URL: http://localhost:<port>/ (<port> is your port number)
Save Changes
My solution:
Leave App Domains empty
(Products) Facebook login > Settings
Add http://localhost:85/my_app/ to Valid OAuth redirect URIs box
Save Changes
Leave App Domains empty
Go to Website with Facebook Login
Add http://localhost:port_number/
Save changes and try again.
For more information visit
http://developers.facebook.com/docs/samples/canvas/
Happy coding :-)
This has changed some over the years, but I just got it to work with a webapp that I'm running on localhost. This is what I did:
Goto https://developers.facebook.com/apps
Select your app.
Select Settings > Basic from the left hand nav bar.
Click the Add Platform button at the bottom of the page.
Click Website
Enter http://localhost:8080/ for the Site URL.
Click the Quickstart button to the far right of the Site URL you just entered.
A new tab will open. On that tab, scroll down to the section, "Tell us about your website" and again enter http://localhost:8080/ for the Site URL.
Click the Next button.
Attempted to login again, and it worked this time.
Good luck!
2018 working solution
It took me ages to figure this out, so I'm going to share my solution.
I tried all the suggested answers, but nothing worked for me, and in the end all I had to do was to go to https://developers.facebook.com/apps/YOUR_APP_ID/fb-login/settings/, and add my full callback url in the Valid OAuth redirect URIs box.
In my case, using ruby on rails, my url looked like this http://localhost:3000/user/auth/facebook/callback.
And right after I added it, everything started working! Hope this helps someone else facing this issue.
This is what I used to do.
If you are using Windows, you need to modify the host file. Host file location will be at %SystemRoot%\System32\drivers\etc\
Add a new line in host file like this
127.0.0.1 localhost.YOUR-SITE-NAME.com
Save the host file.
Go to FB apps setting control panel and give localhost.YOUR-SITE-NAME.com in Apps domain field. Save changes.
Now load you local environment like localhost.YOUR-SITE-NAME.com from your browser.
NB: change YOUR-SITE-NAME with your domain name.
Working solution (August 2018)
First, select your app in the developers dashboard.
Then make sure your app is in development mode, as it allows localhost over HTTP. To do so, click on the toggle situated at the top right of your app's page.
Finally, please follow the notes below as they could cause trouble if improperly filled:
Settings > Basic > App Domains should be empty
Products > Facebook Login > Settings > Valid OAuth Redirect URIs should be empty
You can either leave it blank or use localhost, http://localhost:85/my_app/ is the URL
When I wrote that tutorial at that time port was allowed in app domain. And I actually able to run app with 81 port (wamp server). Now it looks that facebook is not allowing port in url. You can use localhost in app domain.
I will update information as soon as possible. I am trying to find out solution.
A temporary solution is use localtunnel http://progrium.com/localtunnel/
I tested this and it works for me [Feb 2020]:
Install ngrok & get your https url (example: https://a3asdf23.ngrok.io)
Go to FB App Dashboard Settings (Basic) -> under App Domains -> add https://a3asdf23.ngrok.io, https://ngrok.io.
On the same page, scroll all the way down, Add Platform (Website), set the url as https://a3asdf23.ngrok.io. Not finish yet, click QuickStart -> under "Tell us about your website", put the same url https://a3asdf23.ngrok.io.
Then go to Products -> Facebook Login -> Settings -> Client OAuth Settings -> Valid OAuth Redirect URIs -> add these https://a3asdf23.ngrok.io, https://ngrok.io, https://a3asdf23.ngrok.io/{your-redirect-uri}.
And here you go. Thanks me later :)
You must create a tunnel to share your localhost;
Ngrok is maby the easiest way to do that.
https://ngrok.com
Go through https://ngrok.com/ link to download ngrok and extract that file.
Open cmd ( search cmd)
Go to directory where ngrok is extracted.
Open ngrok from command line ex: c:/ngrok/ngrok.exe [port] or cd c:/ngrok then ngrok 80 ( ngrok [port] )
You will get
ngrok
Tunnel Status online
Version 1.3/1.3
Forwarding http://3ahsdfhska.ngrok.com -> 127.0.0.1:80
Forwarding https://3ahsdfhska.ngrok.com -> 127.0.0.1:80
Web Interface http://127.0.0.1:4040
# Conn 0
Avg Conn Time 0.00ms
Don’t FORGET to make sure your wamp server is open on same port …
(how to check -> goto->wampicon->apache->httpd.conf search for port or 80(default) use that for ngrok.exe 80 )
http://3ahsdfhska.ngrok.com
will be URL for accessing your localhost online
I tried all the solutions mentioned here but none of them worked.
What solved my issue was copying the "OAuth redirect URI" from firebase to facebook app "Valid OAuth Redirect URIs"
I left all the domains blank
If you are getting the protocol errors, not only do you need to REMOVE the Http:// but also if there is any backslash at the end of the web address, you must remove that too or it won't work. I did this and it worked perfectly! Holla!
Tossing one more solution into the mix:
I set up my website per the instructions, then added a second app (Facebook Canvas) and set that URL to http://localhost:XXXXX. Now I can access FB both locally and in production.
I develop locally and I use this URL: localhost/fb
Then I had to add a website with the following URL: http://localhost
Under App Domains I added localhost.
Now it works. The only issue I had was, that you have to use this URL in all of your scripts. E.g.
$loginUrl = $helper->getLoginUrl('http://localhost/fb/login-callback.php', $permissions);
You can't use 127.0.0.1 here ...

facebook Error App Domain: [IP Address] is not a valid domain.?

I give my production server IP address as App domain in facebook application but it's not saved. It returns error as App domain is not valid. So that I cannot use my facebook connect API.
Can we give IP address as App domain in FB application? If it's not, what is the other way to do?
No, it looks like the app domain can only be a domain and not an ip address.
For example in the app settings page, near the App Domain hover the '?' and see:
Enable auth on domains and subdomain(s)
Also, I found this page: http://developers.facebook.com/docs/appproperties/ it refers to the REST api and so it's not that up to date, but it clearly states there that there are two different properties: base_domain(s) and ip_list.
I suggest that you try to put a normal domain and see what happens.
All Wrong answers. Here is the true
You must click (+ add platform)
then Select Platform choose app I select website the planet icon
Enter
Site URL http://www.yoursitehere.com
Mobile Site URL http://www.yoursitehere.com
go back and enter in App Domains: yoursitehere.com
now click save
go to Status and Review
Do you want to make this app and all its live features available to the general public?
change or move to (YES)
This is what I found works.
From the Facebook development page "Apps-YourAppName", click on Basic in the LEFT Nav.
There are 3 sections on this page: Basic Info, Cloud Services, and "Select how your app integrates with Facebook"
In the Select how your app integrates with Facebook section, select "Website"
Enter your fully qualified domain name in the Site URL dialog box. Example: http://www.mydomain.com OR http://mydomain.com (my site does not include the www so I didn't add it).
At the bottom of the page click the "Save Changes" button. You may receive a notice that it may take several minutes to blah blah blah....but you can continue with the next steps immediately.
Now, in the Basic Information section at the top of this screen, you can now add your App Domain. This should be formatted as mydomain.com. Do not add "http://" and do not add "/" at the end of the domain name.
NOTE: My site does not use the www, so I cannot confirm that it's required in Step #6. Try it both ways if you're unsure.
At the bottom of the page click the "Save Changes" button. You may receive a notice that it may take several minutes to blah blah blah....but you can continue with the next steps immediately.
At this point the error was NOT displayed as it was before.
Hope this helps!
One solution to getting over the problem of using an IP address as a valid domain is to use: xip.io
xip.io is a magic domain name that provides wildcard DNS
for any IP address
Simply add .xip.io after your url and use this as the domain name. Perfect for me as I do my development on a virtual machine!
If you don't have a domain (only the IP) just leave the "App Domains" field in blank. It works! =)
This, IMHO, is Facebook's fault as the error message is really confusing and makes you think only domains are allowed.
Hope it helps someone! =)

App Domain: is not a valid domain

any idea why get this error when I insert my site name in App Domain box ,when ntrying to setup app ? I've tried inserting other domains and I get rhe same error message.
Error
App Domain: http://wordpressblogplugins.com/ is not a valid domain.
i had the same problem. the error log is sketchy. this is the solution:
1st goto WEBSITE (below SELECT HOW YOUR APP CONNECTS...) and click
2nd in the text area, fill in your website http://www.yourdomain.info
3rd go back to APP DOMAIN (BASIC INFO) and type yourdomain.info
This absolutely works but I didn't quite understand the instructions, so I'm going to restate them for other neophytes like myself.
From the Facebook development page "Apps-YourAppName", click on Basic in the LEFT Nav.
There are 3 sections on this page: Basic Info, Cloud Services, and "Select how your app integrates with Facebook"
In the Select how your app integrates with Facebook section, select "Website"
Enter your fully qualified domain name in the Site URL dialog box. Example: http://www.mydomain.com OR http://mydomain.com (my site does not include the www so I didn't add it).
At the bottom of the page click the "Save Changes" button. You may receive a notice that it may take several minutes to blah blah blah....but you can continue with the next steps immediately.
Now, in the Basic Information section at the top of this screen, you can now add your App Domain. This should be formatted as mydomain.com. Do not add "http://" and do not add "/" at the end of the domain name.
NOTE: My site does not use the www, so I cannot confirm that it's required in Step #6. Try it both ways if you're unsure.
At the bottom of the page click the "Save Changes" button. You may receive a notice that it may take several minutes to blah blah blah....but you can continue with the next steps immediately.
At this point the error was NOT displayed as it was before.
Hope this helps!
You should not place URL scheme to the "App Domain" field (it's not a part of domain name), just the domain name like wordpressblogplugins.com

How to Test Facebook Connect Locally

I use ASP .NET and Facebook Connect APIs. but when I run the app and press Connect button it's return to the Website not to the test local server which is (http://localhost:xxxx/test.aspx)
So how I can test Facebook locally (i.e How I can change the callback url) ?
It's simple enough when you find out.
Open /etc/hosts (unix) or C:\WINDOWS\system32\drivers\etc\hosts.
If your domain is foo.com, then add this line:
127.0.0.1 local.foo.com
When you are testing, open local.foo.com in your browser and it should work.
Edit your app at www.facebook.com/developers/ and set the "Site URL" to "http://localhost/myapppath".
When done - change it back.
Facebook has added test versions feature.
First, add a test version of your application: Create Test App
Then, change the Site URL to "http://localhost" under Website, and press Save Changes
That's all, but be careful: App ID and App Secret keys are different for the application and its test versions!
I suggest creating a test app (for dev environment only) on https://developers.facebook.com/apps and set: Website with Facebook Login property to your localhost:[port] settings.
this option will work fine with no need to change hosts.
remember to change the appId back to your production app once you go live.
Edit - in the latest fb version you'll find it under the settings tab.
You don't have to do anything difficult!
Facebook → Settings → Basic: write "localhost" in the "App
Domains" field then click on "+Add Platform" choose "Web Site".
After that, in the "Site Url" field write your localhost url (e.g.: http://localhost:1337/something).
This will allow you to test your facebook plugins locally.
Facebook seemingly randomly disables the ability to set localhost as a domain on your facebook app. I found the easiest work around was to tunnel my localhost to the web. This can be done for free using http://progrium.com/localtunnel/ or with a custom url (easier since you don't have to change url everytime in facebook) https://showoff.io
I couldn't use the other solutions... What worked for me was installing LocalTunnel.net (https://github.com/danielrmz/localtunnel-net-client), and then using the resulting url on Facebook.
Looks like FB just changed the app dev page again and added a feature called "Server IP Whitelist".
Go to your app and Select Settings -> Advanced Tab
Get your public IP (google will tell you if you google "Whats My IP")
Add your public IP to the Server IP Whitelist and click Save Changes at the bottom
go to canvas page..
view it in browser.. copy the address bar text.
now go to your facebook app
go to edit settings
in website, in site url paste that address
in facebook integration , again paste the that address in canvas url
and also the same code wherever you require canvas url or redirect url..
hope it will help..
LAST TESTED 2021/06/07
Just a few notes to complement the excellent answer of #Erdal_G with my successful experience:
Apparently, HTTPS is needed even in the local environment (I used the library https-localhost).
[I don't know if this is mandatory] create a test app from the main app (https://developers.facebook.com/docs/development/build-and-test/test-apps/)
Set the redirect OAuth URI to https://localhost:<MY_PORT>/auth/ and update also all other URIs in .../instagram-basic-display/basic-display/ settings accordingly.
Finally, don't forget to use the client-id (aka app-id) and app-secret of the test app in the requests, which are different than the parent app
Create 2 apps and
In /initializers/env_variables.rb
if Rails.env == 'development'
ENV['FB_APP_ID'] = "HERE"
ENV["FB_SECRET"] = "HERE"
else
ENV['FB_APP_ID'] = "HERE"
ENV["FB_SECRET"] = "HERE"
end