facebook url for open authentication login - facebook

First let me say I really sorry for asking a question about facebook.
I'm trying to use open authentication to login in users on my site but I cannot find where to register my application/website on facebook. What is the url?
update
I've done that but get this:
our account must be verified before you can take this action. Please verify your account by adding your <a onclick="var newwindow = window.open("http:\/\/www.facebook.com\/confirmphone.php",'confirm_phone', 'height=350, width=520, left=100, top=100, resizable=yes, scrollbars=no, toolbar=no, status=no');if (newwindow) { newwindow.focus();} else { alert("A pop-up blocker may be disabling the the mobile verification window.");}">mobile phone</a> or credit card.
update
If you get that link you need to paste this into the URL if it doesn't popup.
http://www.facebook.com/confirmphone.php",'confirm_phone&%23039;,%20&%23039;height=350,%20width=520,%20left=100,%20top=100,%20resizable=yes,%20scrollbars=no,%20toolbar=no,%20status=no&%23039;);if%20(newwindow)%20&%23123;%20newwindow.focus();&%23125;%20else%20&%23123;%20alert("A%20pop-up%20blocker%20may%20be%20disabling%20the%20the%20mobile%20verification%20window.");&%23125;
update
Then I have to join this group
http://apps.facebook.com/developer/
And when I do it says it's no longer there.
update
Ok finally got to a link somehow after register my phone.
http://developers.facebook.com/setup/

www.facebook.com/developers
Goto this URL and register your profile as a developer first. Then create a new application.
If you are able to do that successfully, then comment back for the further steps.

Related

PayPal API login error - "Sorry, we can't log you in.."

I am using the paypal api login with this:
paypal.use( ['login'], function (login) {
login.render ({
"appid":"myAppID",
"authend": "sandbox",
"scopes":"email",
"containerid":"lippButton",
"locale":"en-us",
"returnurl":"myReturnUrl"
});
});
when I click on lippButton paypal opens with forms for email and password. When they are filled in I get the error:
Sorry, we can't log you in. If you think there's a problem with your
account, contact us and we'll help resolve it.
Even though If I redirect the user to login/complete payment it is fine. Any ideas as to what the problem is?
EDIT:
Seems like it may just be the sandbox api is down. I went here:
https://devtools-paypal.com/guide/openid/php?success=true&env=sandbox
and clicked "Try it" then clicked on the link for step 2, which pops up an identical login form that I am using and the error message persists there as well.
EDIT:
Can anyone explain how I can log in to paypal, but not from their sandbox using my paypal credentials?
I found the problem. For anyone in the future with this same problem (I'm assuming many will because it is directly following their walk through), you seem to not be able to log in via "sandbox" mode (even though their provided code sample has authend: "sandbox" in it).
Simply put in your live credentials INSTEAD of your sandbox credentials. The log in should look like this (There should be no 'authend: "sandbox"' now):
paypal.use( ['login'], function (login) {
login.render ({
"appid":"myAppID", //Use your live client ID, not your sandbox client ID.
//No authend needed.
"scopes":"email",
"containerid":"lippButton",
"locale":"en-us",
"returnurl":"myReturnUrl"
});
});
And the login now works and allows you to login.

Paypal login freeze (opencart 2.1.0.2)

I added the option to login with Paypal.
I am using the Paypal standard login.
I am using sandbox for testing but the issue persists even if in real mode.
Everything is ok except after the login with the email of paypal, after I input the credentials of paypal account it goes to load the setting from paypal account that I selected (name, date of birth etc,) it goes ok and after that it freezes in the same login window (a blank window).
In the site it does not do anything and doesn't login.
I noticed that the url in the login window goes to the redirect that I had to configure. I think that maybe it's related with the redirect URL. Can anyone please check if everything is ok with the settings or if it is a known bug with this?
The full url that appears in the login windows after the credencials are submitted is:
https://www.quitandabrasil.com/index.php?route=module/pp_login/login&scope=address+profile+email+phone&code=nhZpJ2YmnH_R3HXkheGFfPErrJluZ-fDhfDFuPgqLzwYX1AmNYNEfbjPiT5D-46YO-LaPWLQU98CVEoWO5ndUMfC1XGWOMg_yAJ6ZYCK_EpC1ns4Crl6A5bDV1DdAbrTbJlRthHtbpM1NAVBJpxskbViJjGhgdczvInmmSg8BCdEupPDJzKCb2j9RLoKZl8EEeD0pVBov2zRjrq2
I have uploaded pics of the opencart config "login with paypal" and from the developer site that have the sandbox account.
DGjlR.jpg
You can refer to https://github.com/opencart/opencart/issues/3640
Change the API URLs
//$endpoint = 'https://api.sandbox.paypal.com/v1/oauth2/token';
$endpoint = 'https://api.sandbox.paypal.com/v1/identity/openidconnect/tokenservice';
//$endpoint = 'https://api.paypal.com/v1/oauth2/token';
$endpoint = 'https://api.paypal.com/v1/identity/openidconnect/tokenservice';
Comment/remove line:
//CURLOPT_USERPWD => $this->config->get('pp_login_client_id') . ':' . $this->config->get('pp_login_secret'),

How to redirect the user to a custom page when user click "Connect to QuickBooks" button?

So Intuit charges for each active connections to QuickBooks. Therefore, I want to restrict the QuickBooks functionality in my application to premium users only.
Ideally when any user clicks the "Connect to QuickBooks" button and my RequestOAuthToken http handler is called, I want to check if the user is allowed to use QuickBooks. If that is the case, then the normal OAuth flow continue. If the user is NOT allowed, then I want to redirect the user to the upgrade page of my app.
Given that the "Connect to QuickBooks" button opens a new window (at least on desktop, I haven't tried on phone/tablets), the window should get closed, and the main window (my app) should redirect the user to the right page. And actually this is exactly what happens if the normal OAuth flow completes.
Now, I have tried a few different approaches but I couldn't get it working.
1) In my RequestOAuthToken, return a HTTP redirect to the plan page
2) In my RequestOAuthToken, return an html page with javascript logic to redirect to page
3) In my RequestOAuthToken, return HTTP redirect to a page with javascript logic to redirect to page
4) I haven't tried that one but could I somehow intercept the javascript click handler on the Intuit button. I'm not sure if that is an accepted practice.
Here is the piece a javascript I grabbed from the .Net sample:
try
{
var parentlocation = window.parent.opener.location.hostname;
var currentlocation = window.location.hostname;
if (parentlocation != currentlocation)
{
window.location = plansUrl;
}
else
{
window.opener.location.href = window.opener.location.href;
window.close();
}
}
catch (e)
{
window.location = plansUrl;
}
Help me out please.
I don't think you'll be able to do exactly what you're asking, but you can probably come close by taking a different approach.
Rather than trying to redirect them after they click the button, why not try to redirect them before they click it? e.g. when they try to get to the page that has the "Connect to QuickBooks" button it, check if they are a premium user there, and redirect them if they are not.
I don't think you'll be able to redirect them after they click the button because once they click that button, they get kicked over to Intuit's website and it's beyond your control at that point.
Clement, Keith has provided the answer we would want you to pursue. You may not alter the behavior of the Connect To QuickBooks button. It must be used as described in our documentation. Providing a link to a page that shows the Connect To QuickBooks buttons for your premium users and an upgrade message to non-premium users is the way to go.
I highly recommend that you visit http://docs.developer.intuit.com/0025_Intuit_Anywhere/0010_Getting_Started/0040_Publishing_Your_App and review all of the documentation there. If you develop with our guidelines and requirements in mind it will speed up the review process.
Tony Purmal
Developer Relations Engineer
Intuit Partner Platform

how to send and receive data between phonegap child browser to main application

I'm working on a Facebook login authentication in a Phonegap child browser. For that externally I have a page that can initiate authentication process and redirects back after authentication (let's say www.mysite.com/Facebook.html). Now I have authentic user from Facebook, but how can I get that authentic user data from child browser to main application and close child browser. for security reason, I set "showLocationBar: false" , so there is no close button.
So, now let me know
how can I get Facebook authenticated user data (user email and access token for further transactions with Facebook) to main application and close child browser.
how to close child browser from child browser as I don't have close button on Child-browser.
is there any way to save data from Facebook to a JavaScript object in my main application
This is my first application with Phonegap, but im experienced with Facebook and JavaScript. So , please let me know if I'm wrong any where.
Thanks in advance,
Looking forward.
I am also using chilldbrowser for Facebook connect. Here is the link for complete source code for Facebook connect using childbrowser: http://www.drewdahlman.com/meusLabs/?p=88. You can get user's name using access_token using the code below:
var params='access_token='+accessToken;
$.get("https://graph.facebook.com/me",params,
function(response){
fbUesrName=response.name;
},"json");
You can close the childbrowser using:
window.plugins.childBrowser.close();
#Venkat : Not sure if you already got the answer for closing child browser from within app. This code worked for me. Put a close button on your site and put the URL as "google.com".From PG app you can write the code below
window.plugins.childBrowser.onLocationChange = function(locationLink){
if (locationLink.indexOf('google.com') > 0) {
window.plugins.childBrowser.close();
}
}

facebook login give me already authorized this app without automatic returning to the app

My app should implement login with facebook but I have noticed that every time I want to login the facebook tell me you are already authorize this app , the question if I already authorized the app the facebook should return automatically without pressing the okey button as I saw in other applications ?
see the attached image
I fixed my problem by doing the following steps :
1- login to your facebook as admin to your app.
2- go to https://developers.facebook.com/apps/YOUR_FACEBOOK_APP_ID/summary.
3- go to settings > basic > Native IOS app
4- set the Configured for iOS SSO: to enabled
In iOS/Android the FBAccessToken's expiration time is up to 60 days. When you do FBLogin in your app you get the access token. once you get the token you should not do login again(otherwise you will be prompted already authorized this app since your app has already been given an access token earlier which is not expired ). You should reuse the unexpired access token.
Like this :
if FBSDKAccessToken.currentAccessToken() != nil {
print(FBSDKAccessToken.currentAccessToken().userID)
print(currentAccessToken().tokenString)
//OR call the *FBGraphRequest*
}
Note: for in-App browser login (SVC: Safari View Controller)
see more:
https://developers.facebook.com/blog/post/2015/10/29/Facebook-Login-iOS9/
and
https://developers.facebook.com/docs/reference/ios/4.9/class/FBSDKLoginManager/
You need to make sure that your app has the proper URL Prefix in your Build Settings. Also make sure that the URL Prefix matches your Facebook ID/URL Prefix in the Facebook developer app.
Edit: Your issue is probably that the access_token is expiring so it's have to re-ask for permissions.
This will happen if your application did not request offline_access permissions. In the newer SDK offline_access is deprecated and you now have to extend the access_token.
See this link: https://developers.facebook.com/docs/mobile/ios/build/#extend_token
As this Question is already answered , but i would like to add another helpful answer for Swift 3.0 :
While using FB Login in Swift , i having issue and i previously did this way:
let fbLoginManager : FBSDKLoginManager = FBSDKLoginManager()
fbLoginManager.loginBehavior = .systemAccount
As this uses , System account to check user is authorized for login or not . Unless you logout and login through different user , application shows same "Already authorized" message in place of Fresh login . So i used this way and this trick does the work :
let fbLoginManager : FBSDKLoginManager = FBSDKLoginManager()
fbLoginManager.loginBehavior = .web.
This show Login Screen after logout.
Hope this helps to solve this issue.
Feel free to comment . Thanks.
You should check if there is a current session before logging in with FBSDKLoginManager. Do not use [loginManager logout] before logging in.
if ([FBSDKAccessToken currentAccessToken])
{
NSLog(#"Token is available : %#",[[FBSDKAccessToken currentAccessToken]tokenString]);
// Now get details using graphpath.
} else {
// login with permissions using FBSDKLoginManager and get details using graphpath in completion
}
There is a open bug at facebook.com
https://developers.facebook.com/bugs/190389531089978
But the bug only appears at android, ios works fine.
(btw. same behavior in the foursquare and spotify android app - check it out)
Run your iOS FB application into device not simulator it works fine, and didn't shows the already authorized screen.
Thank you.