Facebook app authentication - php

I made a fb PHP app sample and let my friend to use that. I expected him seeing an app authorization dialog. But The error message "An error occurred. Please try again later" message had been appeared instead.
We got same result even if we use a sample program in FB SDK for PHP.
He could use the app after I added him as a tester on the app's setting page on Facebook.
But he's got same error message after I removed him on the setting page.
I (administrator of the app on the Facebook app's setting) haven't seen error message on my app.
I have been searching for the solution. I have checked followings.
The App's settings; app ID, site URL, canvas URL and app Domain are supposed to be correct.(Otherwise I would not have used the app)
Sandbox mode is disabled.
Please suggest me to let him use the app without adding him on the settings page.
Am I missing something or doing something wrong?
Thanks in advance!

What hosting have you been using.. for your app and how do you know work out https url
I had the same issue when i tried using my app with facebook.com/socialserver for free https service, in that case i had tried my app first under me then completely under my friend administration and then again back to me .
Finally, i had to stop thinking about the free service and switch to the ads version of the service..

Related

PHP Hello Analytics Reporting API V4 with OAuth 2.0

I am trying to access the Google Analytics API for web applications using PHP, like described in this tutorial: https://developers.google.com/analytics/devguides/reporting/core/v4/quickstart/web-php
I have followed all the steps precisely, however was not been able to make it running. I have managed to debug so far that I found out about where the problem is.
When OAuth consent screen pops up and I click Allow, application does not get authorized. I just keep seeing the same popup. Also, if I check authorized apps in my google account, it is not listed there.
Another interesting fact is that Hello Analytics Reporting API V4 using JavaScript is working just fine.
https://developers.google.com/analytics/devguides/reporting/core/v4/quickstart/web-js
Does anybody have a clue about what could be wrong with my app authorization?
OK, now I have additionally discovered it has something to do with localhost. Once I have uploaded the same code to live server, it is working just fine. But I cannot get it working on locahost. Does anybody have an idea how to setup Credentials or whatever to make it working in development environment (localhost)?
Check your browser extensions (i.e. Disconnect) may be blocking the auth token.

Facebook login works on desktop but not mobile

When I try to use Facebook login for my website (it's how we signup users) it works perfectly on a desktop, but when I try on a mobile device the oath dialog says "An error occurred. Please try again later."
Things I have tried/checked:
The appId and secret are all correct with what is in https://developers.facebook.com/
I'm using the PHP SDK for logging in.
I'm using $this->facebook->getLoginUrl(array('scope'=>'email,user_birthday,user_about_me','redirect_uri' => $loginURL)); to generate the login URL.
Does anyone know how else I might debug this issue? Or know what might cause this?

Google Drive DriEdit example not working with my FULL_AUTH_URL

I have set a setup of Google Drive sample DriEdit code in my wesite. It is authenticating user file but once authentication done it take back user to the redirect url, but when i am using default FULL_AUTH_URL url it working file, but in my case it is not working here is my URl.
const FULL_AUTH_URL='https://accounts.google.com/o/oauth2/auth?scope=https://www.googleapis.com/auth/drive.file&client_id=MY_CLIENT_ID&response_type=code&access_type=offline&approval_prompt=force&redirect_uri=http://www.example.com';
You need to replace:
MY_CLIENT_ID by the Client ID of your application which you can find in the Google APIs Console for the project that you have created. See https://developers.google.com/drive/register
redirect_uri bu the URL where the user gets redirect to after he approves the OAuth flow. Usually the main page of your website or a different OAuth handler. This is usually all described in the Dr Edit sample documentation. Make sure you read this: https://developers.google.com/drive/examples/python
You may need to create a "Client ID for web applications" - maybe a service account works, too (web services might be easier to connect, because for service accounts one need to install a certificate file and send it on auth).
Once oAuth is setup properly, you should at least get any error message from Google.
Just don't use the Drive API credentials, they have no function yet.
Hope this get's you started.

Localhost facebook login not working for lower level of the url

Thanks in advance for reading.
I've been working with facebook login (both php and javascript sdk methods) for a couple of years and I'm facing a particular problem with new apps I'm developing.
I have an app in my localhost configured as virtual directory as follows:
http://localhost/myapp/
On facebook, the following settings of my app are pointing to that url: App Domains, Facebook Login Website, App on Facebook (https and http) and Mobile Web.
When I do the login process and point the redirect_uri to http://localhost/myapp/, it works fine, the cookie is set and I can make queries to the graph api.
The problem comes when I try to use another redirect uri like http://localhost/myapp/user_controller/register (Adds the user to the database). Although it is inside the app url configured on facebook, the SDK outputs an error message (OAuthException | An active access token must be used to query information about the current user. | Code 2500).
I figured out that, to solve this problem for a while, I have to go to the facebook app page: apps.facebook.com/myapp. I have to do it everytime my access_token has expired and, since this app is not intended to be inside facebook, I don't think that this is the best way to solve this.
I hope together we can find a good way to solve this issue and this questions helps future developers.
I'm using CodeIgniter (which I've been using about a year) and Facebook PHP SDK (downloaded directly from the github official repo) as CI library.
Thanks again.
At no point would you get that error during authentication.
I'm pretty sure that you instead have an error in your code that fails to exchange the code for the access_token on the .../register endpoint, and so you end up using an invalid access_token.

Adwords API Bad Authentication

I am using Adwords API from last 3 months and all of a sudden today it is coming up with error message as follows:
Uncaught exception 'AuthTokenException' with message 'Failed to get authToken. Reason: BadAuthentication'
I am using google adwords V201101 php library with auth.ini containing all user details and settings.ini with https://adwords.google.com not sandbox environment. Can anyone help me with this please???
Thanks,
Murali.
you may requesting authToken from ClientLogin service too many times, that is way you get 'CaptchaRequired'.
Request authToken just for the first time, and then cache it for subsequent requests.
Check this out http://goo.gl/TOX6N
I recently had this problem trying to connect to Google DFP. I copied perfectly working code from my localhost after development and ran it on my remote cloud server. I then received the
Failed to get authToken
message. The reason was that google was blocking the attempted login as a security measure because it was a new location. I had to log into the google account (from the web) with those credentials in order to see the message and confirm the added login location. Everything worked fine after that authorization.
I've stumbled across this question and thought that this info may help someone else.
BadAuthentication means your username/password is incorrect. May be someone changed the account password, may be auth.ini got modified by mistake.
See detailed error codes here: http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html#Errors
Cheers,
Anash
I started getting this error after somebody in my organization updated the password for the account my app was using to log in. The best way to avoid this happening again is to use OAuth2.
It's as easy as going to the Google API console and creating a Client ID for Installed Applications (under API access) for your project. You then use the Client ID and Client Secret in your Adwords API auth.ini file.
Next you run the examples/AdWords/Auth/GetRefreshToken.php script which will have you grant your app access to your Adwords account. You'll end up with a Refresh Token which you need to add to your auth.ini.
The ClientLogin (username and password) method of authentication is being deprecated in favour of the above so best to migrate ASAP.

Categories