ionic with phonegap-facebook-plugin: invalid hash key - ionic-framework

It worked ok. I logged in with facebook.
After a while, i don´t know exactly the reason, when I try to login with facebook, it starts to show:
Invalid key hash. The key hash ..... does not match any stored key hashes. Configure your app key hashes at http://developers.facebook.com/apps/...
The hash key that is showing in the error message it´s not the hash key set in the developers facebook and had worked before. I tried to put this hash in the developers.facebook but does not work too.
After hours of research:
deleted the app in Facebook developers
remove cordova plugin from ionic project
Delete the file debug.keystore under C:\Users\yourUserName.android
Generate a new key with "keytools"
Create a new app on developers.facebook.com and add the new hash key
Then it started to work again.
But now, its showing me the same "invalid hash key" again :(
Any help?
Edited:
I deleted just the debug.keystore and ran "ionic run android".
Then showed me the same error but with a new hash key,
I tryeid again to put the hash key that they show in the error message and it is working now. But it´s very strange, because the hash key that I generated with "keytools" and put in developer.facebook for the first time, was just for nothing.
I follow this tutorial: https://ionicthemes.com/tutorials/about/native-facebook-login-with-ionic-framework

Download APK (your_apk_name.apk)
Run Command keytool -list -printcert -jarfile your_apk_name.apk
Copy the SHA1 value
Go to http://tomeko.net/online_tools/hex_to_base64.php
paste SHA1 value & hit convert.
Copy the output(base64) and use this as your facebook hash.

You need to add all key hashes that you see in those error messages to the setting of your Facebook app. Go to developers.facebook.com/yourappid, to settings > basic, scroll down to key hashes and add it there. We've got 4 different hashes for ours now and I'm sure they'll be more going forward.
It seems that having other applications on the users phone that are using Facebook login can change the hash needed by your app in login. So like, if you've got the main Facebook app on your phone, it'll require a different hash for your app's login than if you have just Facebook Messenger. This is our working theory that holds up against all evidence so far.
I'd recommend setting up a logger for client errors so you can get those hashes as they pop up. This obviously isn't the ideal solution so I'd love to hear what others find out about this but, for now at least, it's working.

Related

Firebase something went wrong flutter

I'm new to coding and I'm trying to create a login page with Firebase but the problem is that when I put my email + my password I have this message that appears:
W/System (30113): Ignoring header X-Firebase-Locale because its value was null.
D/FirebaseAuth(30113): Notifying id token listeners about user ( gZ4NEwxh0qRRl32ypTGvqgX6kJx2 ).
I connected Firebase to my application and I put the authentication by mail, I added the sha1 and the sha-256.
I see nothing wrong with that. Most importantly, you can log into your account.
If you think Ignoring header X-Firebase-Locale because its value was null. should be removed, I suggest you take a look at this answer:
PREPARATION
Check if your emulator has the permission to access internet and also is connected to.
Email/Password Sign-in method in your firebase console is enabled to gain access.
STEP 1: Create sha1 key + debug key information + Adding firebase. You probably have your sha1 key only with the normal
information from the release key, I guess?
STEP 2: Activate Android Device Verification from console.cloud.google.com and insert your sha keys that are
automatically generated by firebase + their matching preferences
(like package name...)
CONCLUSION
Your code looks good to me! Everything is set up right. I think you
forgot some trivial settings or the right sha key.

WinHttpSendRequest returns 12044 ERROR_WINHTTP_CLIENT_AUTH_CERT_NEEDED

since 3 years I acces the ebay api from WinHttp. Since today I get error 12044, ERROR_WINHTTP_CLIENT_AUTH_CERT_NEEDED, after calling WinHttpSendRequest. May I use whatever SSL certificate and load it from the store? Getting one from letsencrypt.org, install it and load it by CertFindCertificateInStore and enable it with WinHttpSetOption? How ebay know that this certificate is connected to my credentials like appid, certid and runame?
I have no idea what to do, sorry for that question.
Got it. Created a self-signed certificate, add it to store, exported a private key, granted access to this private key and load the key after creating the request.
WinHttpOpenRequest...
CertOpenStore...
CertFindCertificateInStore...
WinHttpSetOption...
CertFreeCertificateContext...
CertCloseStore...
WinHttpSendRequest...
In fact, added the lines from CertOpenStore to CertCloseStore. Nothing else changed and it works.

Cannot insert duplicate key row in object dbo.durados_UserSocial

I'm testing backand platform and got this error
http://localhost:8100/?ionicplatform=ios&error=%7B%22message%22:%22Cannot%20insert%20duplicate%20key%20row%20in%20object%20%27dbo.durados_UserSocial%27%20with%20unique%20index%20%27IX_durados_UserSocial_UserId_Provider%27.%20The%20duplicate%20key%20value%20is%20(387068,%20facebook).%0D%0AThe%20statement%20has%20been%20terminated.%22,%22provider%22:%22facebook%22%7D#/tabs/dashboard
This is a project started from http://market.ionic.io/starters/ionic-backand-with-social according to Getting started mobile.
I couldn't get any match on google
I think it could be because I'm logging in with the same account that I created the app in backand, however, shouldn't it be possible to just make a login instead of try to register it (or whatever it's trying to do)?
This worked with project default keys for facebook.

Facebook Plugin in for unity, key hash incorrect

Unity 5.3.0 Facebook Plugin 7.3.0
I am trying to log on to Facebook in my Unity app. I am doing a development build at this point and not a signed release build. In the editor, Facebook settings shows one Key hash value. When I build and run the app on the device, the login fails with the following message:
[ 01-05 15:32:12.551 6001: 6001 V/com.facebook.unity.FB ]
Exception during service
com.facebook.http.protocol.ApiException: [code] 404 [message]: Key hash DIFFERENT_KEY_HASH= does not match any stored key hashes.
sending to Unity OnLoginComplete({"error":"Invalid key hash. The key hash DIFFERENT_KEY_HASH= does not match any stored key hashes. Configure your app key hashes at http://developers.facebook.com/apps/12345678909876","callback_id":"1","key_hash":"DIFFERENT_KEY_HASH=\n"})
The key hash in the message is different from the one in the Unity editor. I had both key hashes added to the facebook developer's console. I still get the above error message.
Why are there two different key hash values, one displayed in the editor and one in the logcat? Is this a problem? Which one is correct? Why would this error continue even after the Facebook developer console has been updated?
Logcat's one is correct. I normally use to do this. That is put the editor Key Hash in Facebook app, then check the log, add that key hash too. :)
Double check your key hash (log's one).
Paste your log in answer too, if possible.
But my answer is the log's key hash should work.

Invalid android_key parameter - Facebook login

I am trying to use facebook login in my application. The problem is that I am getting the following error:
My settings are:
In the begging I tried to use a key that I generate using the java keytool but it didn't work (same error). Then I saw some post here in Stackoverflow and I changed the key to the one that appears on the error, but the problem remains.
Any idea what I am missing?
Does the = needed at the end of the key?