Facebook Error 191 and Subdomains - facebook

I have an application that I want to have Facebook Authentication setup on. The application is using a loose MVC framework and thus the handling for the Facebook Authentication (the redirect) needs to be done via a module. Since this is under development I'm working off a development URL, which is a sub domain.
I've created an app, put it in sandbox mode, and set the App domain to "example.com" and the Site URL to "http://dev-site.example.com". My login URL is generated via the current Facebook PhP API and the redirect_uri is /facebookauth/processResponse. I click the link and get....
An error occurred with FTR_Sandbox. 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.
I'm at a loss here, I've tried a lot of different settings (Add Domain including the sub domain, with training slashes, without training slashes) and I keep getting that error.
What am I doing wrong!?

If your app url is sub-domain.domain.com, Then add sub-domain.domain.com as your domain

Related

"The client ID is missing or invalid" in OAuth request

I'm trying to set up OAuth2 flow between my application and Smartsheet, using the instructions at http://smartsheet-platform.github.io/api-docs/?shell#oauth-flow.
It seems as if the client_id parameter is being lost when the user submits Smartsheet's authorization dialog. Here's what I'm seeing:
My web page displays a link to https://app.smartsheet.com/b/authorize?response_type=code&client_id=[my_client_id]&scope=READ_SHEETS%20WRITE_SHEETS%20SHARE_SHEETS
(From here on, I will be omitting the protocol and domain from URLs, as I have posted little enough to Stack Overflow that I am unable to include more than two links in a question!)
I click that link, and wind up on /b/authorize?formName=fn_authorize&formAction=fa_loadAuthorize&response_type=code&client_id=[my_client_id]&scope=READ_SHEETS+WRITE_SHEETS+SHARE_SHEETS . The dialog shows the logo and name of my web site, so I know that the client_id is correct.
Then I click "Allow" and see the message "The client ID is missing or invalid" at /b/authorize?formName=fn_authorize&formAction=fa_loadAuthorize&redirect_uri=[my redirect uri]
I've gone over the instructions a couple of times to make sure the URI I'm generating is valid, and have tried it with and without the redirect_uri parameter.
What might I be doing wrong?
I'm unable to reproduce the issue you've described, even using the oAuth URL copied exactly from your post/question. Here's a recap of my test scenario:
Created new "App" (via Developer Tools in the Smartsheet UI) to generate a client id and app secret.
Redirected user to: https://app.smartsheet.com/b/authorize?response_type=code&client_id=[my_client_id]&scope=READ_SHEETS%20WRITE_SHEETS%20SHARE_SHEETS
User clicks Allow.
User is successfully redirected to the redirect URL that's specified in my App config settings.
So, Smartsheet oAuth appears to be functioning successfully. Which would seem to suggest that perhaps it's something specific to your App config settings that's causing your issue. A couple of suggestions for troubleshooting:
Try editing your App config settings to (temporarily) replace the value of App redirect URL with something simple like: http://www.google.com -- then test oAuth flow again. If it works with the new redirect URL, that'd suggest an issue with Smartsheet not being able to redirect to your original redirect URL (and the "client id is missing or invalid" error message is not really an accurate message).
If changing the redirect URL doesn't resolve the error -- perhaps try creating a new App altogether (via Developer Tools in the Smartsheet UI), and attempt the same oAuth flow using that new App's client id. If for some reason there's something corrupt about the App that's giving you the error now, then it's possible that starting over with a new App altogether will resolve your issue.

Facebook login API not working

I'm receiving the following error:
Given URL is not allowed by the Application configuration.: One or
more of the given URLs is not allowed by the App's settings. It must
match the Website URL or Canvas URL, or the domain must be a subdomain
of one of the App's domains.
The application URL is https://mysubdomain.herokuapp.com/social/login
In FB App settings...
Basic settings
Advanced settings
Error received
I'm able to get Google+ and Twitter working, but Facebook is being stubborn. What am I missing?
I removed the App Domain and Redirect URI, and it started working. I'm not sure if this is a safe/smart approach, but it at least got things working.

Facebook App: Firebase Simple Login URL error

I am trying to make my first app using Facebook login and the Firebase Simple Login. I am running the system locally on http://localhost:8000/. The error I am receiving upon clicking the login button is below.
"Given URL is not allowed by the Application configuration.: One or
more of the given URLs is not allowed by the App's settings. It must
match the Website URL or Canvas URL, or the domain must be a subdomain
of one of the App's domains."
I have tried running it on a production facebook app and a facebook test app as well as added URL redirects and website platforms following other forum post I have seen, but nothing is working for me. Anyone have any suggestions?
I discovered in the Firebase documentation that https://auth.firebase.com/auth/facebook/callback must be input into the Valid OAuth redirect URIs under the advanced settings.
Recap of Facebook Test App Settings:
Under Basic App Settings:
Domain = localhost:8080
URL = http://localhost:8080
Under Advanced App Settings:
Valid OAuth redirect URIs [http://localhost:8080/ ; https://auth.firebase.com/auth/facebook/callback]
with newest version, Valid OAuth redirect must be set as : https://.firebaseapp.com/__/auth/handler

Invalid URL error message for integrating FB Apps into website with user using static IP

I'm living in Vietnam now. As I known and tested, FB is blocked now. Therefore I have to use static IP for facebook (60.254.175.42). Using this method, I can log into Facebook from WEB browser without any problem. But when I use OAuth protocol to integrate FB into my website (ex. allows user use FB account to log into my website), I always receive the message 'The requested URL "/oauth/authorize?client_id=152190004803645&response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3A8888%2Ffb&scope=publish_stream,email,user_birthday,user_location", is invalid.
Reference #9.26affe3c.1328519733.956d48'.
Please advice,
Thanks
Ensure that you using full URL and no just part of it before redirecting user, full URL should look like this:
http://www.facebook.com/dialog/oauth/authorize?client_id=152190004803645&response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3A8888%2Ffb&scope=publish_stream,email,user_birthday,user_location
Also check that you defined localhost as App Domain in your application settings.

Facebook Application

I'm having a problem with my Facebook application, I got an error like this.
API Error Code: 191
API Error Description: The specified URL is not owned by the application
Error Message: redirect_uri is not owned by the application.
What are the best solutions for this error?
I assume you have the Website option active in your app settings.
Did you fill the site url there?
Thing is, if you own the site.com domain and specify it for your app, you will not be able to use a redirect url to othersite.com after login, or even domain.site.com. I think you need to specify if you are going to use subdomains.
Anyway, what sort of app are you trying to build? Is it a Canvas App? Does this error appear when you try to ask for permissions or login the user? In this case, just fill out the Site URL in your app settings page