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.
Related
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.
I have a purchased license at fusion charts. Fusion charts document says here... https://www.fusioncharts.com/dev/upgrading/license-activation that i have to use this function call for applying license...
FusionCharts.options.license({
key: 'KEY_GOES_HERE',
creditLabel: false,
});
if i put my key in that anyone visiting my website can easily take it from view -> source of browser. how do i avoid it ? It is simple HTML website.
You can use either of the followings :
Instead of passing the keys directly in JS code, pass them via the environment, application variables. And add the env file to gitignore
Use Obfuscation for the key and JS code being used for license activation.
You can store the value of the key in your database & and fetch the data value so that the end-user is unable to access it.
If you know the domain/sub-domains where charts will be used, you can restrict the license keys to those domains by sending a request to sales#fusioncharts.com
As far as I know, there is no way to completely hide it from the frontend. The reason for this is that even if the key is hidden in some way when the request is made, the information has to exist and so the key could be found by looking at the request data.
What you wish to protect against determines how you should go about it. If you would just like to hide it from being picked up by webscrapers, then I would imagine encrypting it and then decrypting it before you send would be sufficient.
If you would like to protect against anyone stealing it, then the only way is to have a server act as a proxy. You would make a call to an API which would then use your API key on the backend, away from the prying eyes of users. Your backend API would then just return to the user the response from fusioncharts.
I created a GitHub Webhook function, copied and pasted the Function URL and GitHub Secret to the GitHub to the WebHook I created in GitHub and I keep getting the following error.
{"Message":"The WebHook signature provided by the 'X-Hub-Signature' header
field does not match the value expected by the 'GitHubWebHookReceiver'
receiver. WebHook request is invalid."}
Any ideas what I'm doing wrong?
OK, so it turns out the GitHub Secret from the Develop page matches the _master key from the Admin Keys (All Functions) keys on the Manage page.
When I used the default key from the Function Keys it started working. By the names of those sections that sounds like the key I actually want to use and maybe the portal is displaying the wrong one in the GitHub Secret field.
Not sure if this is the answer or a workaround.
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.
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.