I'm using Socialite plugin for login with facebook.
When I create application on facebook and when I put this callback url http://localhost:8080/code/example/public/facebook-login-callback
error
If you wish to change your callback URL your new URL must use SSL and start with https.
Any ideas?
Check App Domain and Site URL value in your facebook app. May be this is your solution.
The error message is quite straight forward there: Your callback URL needs to use SSL (means (amongst other things): it must start with "https").
Related
I know this question has been asked several times, but none of them are helping me. This functionality was working up until a day ago. Now I am getting this error and do not believe I have changed anything on our servers. But I know something must have changed.
Here is the url my app is trying to redirect to:
https://advocacy-test.hrmarketer.com/advocacyTest/HRmIWeb/web/facebook/auth?code=AQC6QmTOU4q__kdLDkmuqIrysoJiY1eX-HrvQtE8FeqPbOPNM22gZl4niOwEVXm_3mkBdsiYto0CnswpuLgdqbrdILIea4z1VCfpNt2CQwbfGJ61I_1QNDi7eIF3jR6Sw2JzKstcXSUi2Hydt8frN9Cg2pLrLDeSiOPgV9rO7E5O6ikhUDGAt3vYiWKb6P3nn65FPM_C5ZYczOVnYhU8Qpe8Oj4O8VTtQtR7WgayVoQP6nCldvcDjRQpnNVolJI_c_lLeTRFGQhFod-w3P_rbACRyzARxD5nYAu2jblBKHHhKQWDRD_vHl19r78mlQLPAz9M3GZcFs-xEbE2K97q_D1z&state=bdd6a2a608a7249d0cf7102fd1150341#=
When I check this in my FB app settings it says it's a valid callback uri. What could be the issue?
Redirect URI to Check
Check URI
https://advocacy-test.hrmarketer.com/advocacyTest/HRmIWeb/web/facebook/auth
check
This is a valid redirect URI for this application
From Facebook app settings
Step 1: You have to go to your code and add your URL:
$redirectUrl = "http://example.com/[auth_link]";
Step 2: Go to your Facebook App Setting and add add the exact URL above.
May be your problem is you missed WWW -> the solution add both WWW and no-WWW versionsto whitelist in Client OAuth Settings
OR you missed parameters after URL: eg: ?back=xxx
Consider this example for authentication from PHP at https://developers.soundcloud.com/docs/api/guide#authentication seem to suggest you can pass a redirect url as a parameter when you flow a user throught the authentication process:
require_once 'Services/Soundcloud.php';
// create client object with app credentials
$client = new Services_Soundcloud(
'CLIENT_ID', 'CLIENT_SECRET', 'REDIRECT_URL');
// redirect user to authorize URL
header("Location: " . $client->getAuthorizeUrl());
Note the 'REDIRECT_URL' argument in the call to the constructor.
That seems to suggest I can pass an arbitrary redirect url as a parameter, just like you can do with Twitter (the API is quite similar).
However, if I pass an url that does not match the unique redirect url configured for the application, I get an error when the user is redirected to my url:
error=redirect_uri_mismatch&error_description=The+redirection+URI+provided+does+not+match+a+pre-registered+value.
So, what is that parameter supposed to be for, if the only valid value is the redirect url configured for the application?
And how are you supposed to handle authentication if the user can only be redirected to a single fixed url after authentication?? That makes the API completely unusable. When you have a user login into any API (e.g. Twitter or Facebook), you need them to be returned to the page from which they clicked the link to log in, and it is a ridiculous restriction that that url be unique. No other social network api that I've ever seen has this restriction.
Is SoundCloud API really so flawed or am I missing something?
I got an answer from Glen Scott, the author of the php-soundcloud library (a pretty decent wrapper around this terrible API) who provides a workaround. It's painful as it involves an additional redirect but it's all the API allows.
https://github.com/mptre/php-soundcloud/issues/36
I quote:
The API does not allow an arbitrary URL. As you noted, this is unlike
most other oAuth-backed social network API's. The workaround I can
recommend is using the state parameter to pass back your return URL.
You can do this when generating the authorization URL like this:
$client->getAuthorizeUrl(
array(
'state' => 'http://example.com/return'
) You'll get the state parameter added to the static redirect URL. For example, if you set your redirect URL to
http://example.com/callback then SoundCloud will redirect an
authenticated user to
http://example.com/callback?state=http://example.com/return
Your callback script will need to look for the state GET parameter,
and redirect using it.
There are many other question related to this, but they didn't help me fix my problem.
I'm using the Facebook server-side login for a website, which I want to test locally. The path that initiates the login action is [http://localhost:8080/fblogin] (this redirects to the Facebook login dialogue, and goes from there).
I can successfully get the code, but when I try to exchange that for an access token, I get the following error:
{"error":{"message":"Missing redirect_uri parameter.","type":"OAuthException","code":191}}
I am providing the redirect_uri, url encoded and it is the same as the one I use to get the first code. Here is the url I'm using to request the access token (with the all-caps query string parameters replaced with their actual values, of course):
https://graph.facebook.com/oauth/access_token?client_id=CLIENT_ID&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2Ffblogin&client_secret=CLIENT_SECRET&code=CODE_FROM_FB
I suspect this might have to do with how my app is set up on Facebook. Here are the values I have set:
Display Name: (an actual display name here)
App Domains: localhost
Contact email: (an actual email here)
Site URL: [http://localhost:8080/fblogin]
What do I need to tweak in the settings to get this to work? Or does this look correct?
By the way, if it makes any difference, I am using the Play! framework, version 2.0.1
After digging around a little more, I found that it was necessary for me to use POST when sending the request from my server to get the access token.
Interesting that using POST worked for you as this didn't for me.
In any case, did you add the query parameters using setQueryParameter()? (see How to make multiple http requests in play 2?)
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Facebook API error 191
I'm developing a Facebook app. When I attempt to get an access token, I get the following message:
An error occurred with test. Please try again later.
API Error Code: 191
API Error Description: The specified URL is not owned by the application
Error Message: Invalid redirect_uri: Given URL is not allowed by the Application configuration.
https://developers.facebook.com/apps/.../summary
I've configured the app's domain (appsdot.xxx.com), name and other attributes.
What is causing this error, and how do I fix it?
The redirect_uri must contain the Site URL or Canvas URL as defined in your App Settings. I always get this error when I set a redirect_uri that doesn't contain the URLs in App Settings.
I got this error because I had a trailing slash on my Canvas URL and neglected to include the trailing slash in the redirect_uri.
be carefull error is about uri (i spell: Uniform Romeo India) and the most probably you are using word url (i spell: Uniform Romeo Lima) ... do you see the difference???
just add st like this:
redirect_uri: 'YOUR_PAGE_TAB_URL OR CANVAS_URL'
how simple,isnt it?
this just because of URL mistake
whatever website url is specified should be correct.
i mentioned website url as http://localhost:3000/ and domain as localhost
but in my browser i was running http://0.0.0.0:3000/ that was the actual problem so i ran server as localhost:3000 now its working fine. Because we mentioned site url as localhost fb will redirect to same, if we r running 0.0.0.0:3000 it will rise error that Given URL is not allowed by the Application configuration.
so becarefull with your website url you have specified in facebook app.
and the url you are running locally both should match
thank you
In my case, the problem was happening because I didn't configure the site domain in the right way.
You can access your site model by the admin and change the domain name from example.com to the real domain that you are using.
The best way to fix this is create a fixture; something like:
YOUR_APP/initial_data.json:
[{"pk": 1, "model": "sites.site", "fields":
{"domain": "127.0.0.1:8000", "name": "127.0.0.1:8000"}
}]
Make sure your domain is not being masked.
The base_url must contain the Site URL or Canvas URL as defined in your App Settings. I always get this error when I set a redirect_url that doesn't contain the URLs in App Settings.
You do have to register/create the url with facebook, by creating a facebook app. You might have to give the mobile phone number to them. The Site url you put in there needs to passed as the redirect url.
rails#{This error is related to URL}
-I just put the ip address in all the URL instead of localhost..now it's working file before doing that I tried so many things but didn't work..I am sure this one will work..
I'm trying to pass some variables to my facebook app from the url, i.e. using GET variable app_data like facebook wants.
At some point I've stopped getting the ['signed_request'] part of the $_REQUEST. When I print_r($_REQUEST) I'm getting: ['doc'], ['user'], ['__utmz'], ['__utma'] and ['session'] values, but not signed request :(
Any ideas of why this might be happening?
Check the tab/canvas url is EXACTLY the same as required. If there is a redirect to another page, then signed request and other values will not be sent. You can check using a browser sniffer, if a call to the page responds with a 300 (301/302 etc) redirect, then you need to change to what it redirects to.
Examples:
https://example.com/ may need to be https://www.example.com/ (add www., or remove www. depending on how server is set up)
www.example.com/ may need to be www.example.com/index.php (add index.php, or the right page).
Check you are using http:// and https:// correctly in the URLs, and that https:// returns a valid page.
I've only been able to get the signed request in https://, i get no request at all in http.
Currently have a bug on FB, but no word on fixing it yet; http://developers.facebook.com/bugs/264505123580318?browse=search_4eb3ef23eb18d6649415729
EDIT:
http://SITE.com was redirecting to http://www.SITE.com, so I was loosing the request variables.
Had a similar issue, for me it was as simple as a mismatch of the app id and app secret! However in facebook developers backend I have noticed that the URLs all need to have that trailing slash!
Some browsers do redirect your request to https automatically if you have been on this particular site on https so if you are in http mode on facebook there is situation:
facebook requests http version of your app, browser redirect this request of facebook to https and POST data and thus signer_request are gone in this process...
i see this problem in chrome 23, if you delete browsin data (particulary Deauthorize content licenses) app should run back on http