Facebook Auth Invalid Hash Key on Flutter?
I'm currently developing an app in Flutter and trying to authenticate it with the flutter_login_facebook package and appearing to have the same problem like in this thread:
Android Facebook integration with invalid key hash
except unfortunately the answers are for android only projects or irrelavent due to the date.
I searched all over for a solution with no success and would be grateful for any help, thanks!
1 answer
-
answered 2022-05-04 10:16
suzan
Seems like you have yet to add the key hashes for the facebook app you have created.
You should add the hash key for the Android in the facebook app dashboard -> settings -> basic -> Android (presuming you have already created an app).
To generate the key hash,
// Build Debug keytool -exportcert -alias mstoreapp -keystore android/app/mstoreapp.keystore | openssl sha1 -binary | openssl base64 // Build Release keytool -exportcert -alias key -keystore certs/key.jks| openssl sha1 -binary | openssl base64
Please follow this tutorial for detailed steps
do you know?
how many words do you know
See also questions close to this topic
-
how to change prettier format for react native
my code formatting prettier didn't works well for react native, i don't understand where to config it but it works well with flutter
from this code
import { View, Text } from 'react-native' import React from 'react' export default function App() { return ( <View> <Text>Apps</Text> </View> ) }
it's formatted to this
import { View, Text } from 'react-native' import React from 'react' export default function App() { return ( < View > < Text > Apps < /Text> < /View> ) }
-
How to group firebase data in flutter with DateTime?
I am making a chat application in flutter using firebase. I want to show a header with the date whenever the date changes. How can I group messages in flutter coming from firebase on the basis of date and show a header with the changed date?
I have tried GroupedListView package but I was not able to retrieve the chatmessages successfully.
-
Can you make complete apps using Flutter & Dart or just the UI part of an app?
I'm confused about what Flutter framework actually does, I know that it uses Dart and have heard that both of them can be used to create cross-platform apps.
But Wikipedia defines Flutter as a "UI Framework", so my question is, can you make a complete app (for mobile) which also has backend part (communicates with a database) built entirely using Flutter & Dart and not only the UI part?
If you didn't get my question, here is an example:
Suppose a front-end web developer works on client side programming in his job, and the backend logic is written by another backend developer.
When it comes to mobile app development, suppose as a Flutter developer, your job is to create apps, but does that mean that as a Flutter developer, you'll only write the front-end logic and leave the backend part for another backend developer like in web world? Can Flutter developers also write the backend of an app using only Flutter & Dart? If not, then who writes the backend of a mobile app and what tools/languages/frameworks does he uses?
-
Share facebook catalog as instagram post
I creates a facebook catalog to be able to create an image carousel in instagram where the caption changes with the carousel image, as I've learned that that's the only way to implement multiple captions in image carousels of insta posts.
So I've created a fb catalog that I'm running as an ad on insta now, but how can I actually share that fb catalog as a simple insta post, such that it appears on my insta business account?
-
Facebook Catalog not accepting my URL as valid URL?
I've built a facebook catalog and am trying to setup an ad which uses it, however in the part which asks for the catalog item URL, it says my URL is invalid, although it is actually actually a perfectly valid one. I tried all (replacing example with my domain):
All freaking not valid; what is this? Anyone had the same issue? I'm asking my question here because their docs & support are pretty much horrible, to say the least.
And, actually, how can I RUN the ads that I create in the ads manager?
-
how to get facebook app un-restricted when it's missing from the appeal page?
really weird issue with app id 871708929528215, a restricted app that has been dormant for years, i have fixed the crashing problem they complained about, and facebook SAYS i can "submit an appeal" on https://developers.facebook.com/appeal/ , but the app isn't listed under restricted apps! so i cannot submit an appeal there, how do i get it un-restricted when i cannot submit an appeal? timeline:
2020-01-19: get a warning from facebook saying:
(...) Your app 4x4norway.no (AppId: 871708929528215) doesn't comply with the following: Platform Policy 8.1: Verify that you have integrated Login correctly. Your app shouldn't crash or hang during the testing process. During Login, your app or website is crashing or hanging excessively, creating a broken experience for people trying to use your Login integration. To make sure this flow runs smoothly, check that you've integrated Facebook Login correctly. We recommend that you test Login on all integrations. (...)
- at this point, nobody was maintaining the app and nobody read the message.
2020-02-26: got this message from facebook
Your app 4x4norway.no (AppId: 871708929528215) doesn't comply with the following Platform Policies: Platform Policy 8.1: Verify that you have integrated Login correctly. Your app shouldn't crash or hang during the testing process. During Login, your app or website is crashing or hanging excessively, creating a broken experience for people trying to use your Login integration. To make sure this flow runs smoothly, check that you've integrated Facebook Login correctly. (...) Since we're striving to improve the Platform experience, your app's ability to do the following has been restricted. Access to Facebook Login (...) If you would like to revert this restriction, your app will need to be updated so that it is compliant with the above policy. Once your updates are complete, please submit an appeal here for review: https://developers.facebook.com/appeal/. A member of our team will respond within 48 hours.
- at this point, still, nobody maintaining the app, and nobody reading the message.
now skip 2 years ahead in time,
2022-05-06: the code was fixed, login should work now, but the app is NOT listed on the appeal page https://developers.facebook.com/appeal/:
and when i actually try to log in, i get this message:
facebook login error: 1349220: Feature Unavailable: Facebook Login is currently unavailable for this app, since we are updating additional details for this app. Please try again later.
so... with the code (presumably) fixed, how do i get it un-restricted when it's not on the appeals page?
edit: reported the issue to facebook as an apparent bug? ref https://developers.facebook.com/support/bugs/1257714914760781/
-
Redis: single big hash vs many keys
I have some data which has million key-value pairs. So which way is better to store them in redis, single key with super big hash which has million key-value pairs or million keys each having a value?
In my opinion, both ways seems not very good given million pairs.
Any suggestion?
-
Is there JS snipet which can place hashed email into website head for user tracking purpose?
I have clients email list with thousands of double opt-in clients in hashed format as well. Now I need to place with "on click" or "window load" event that hashed email (from newsletter for example) to head of website.
My idea is to place short JS code into head section of website, for example:
<script> window.FnHashEmail = '{email sha hash here}'; </script>
But need help with following - is there any way how to send just exact email hash from database for exact email user when he visits website. I understand logic behid this, but can not assemble approach through code to execute this.
Logic behind: User clicks on link in newsletter, I already have SHA-1 email hash, when he clicks on link, by automation that hash is parsed and placed in the head of website. I know Google do this, Facebook too, but is it possible this to be done without any "big system" development?
-
Same password hash not matching
I am trying to create and test my api for login using C#. Below is the major part of the code:
private static void CreatePasswordHash(string password, out byte[] passwordHash, out byte[] passwordSalt) { using (var hmac = new HMACSHA512()) { passwordSalt = hmac.Key; passwordHash = hmac.ComputeHash(System.Text.Encoding.UTF8.GetBytes(password)); } } private static bool VerifyPasswordHash(string password, byte[] passwordHash, byte[] passwordSalt) { using (var hmac = new HMACSHA512(passwordSalt)) { var computedHash = hmac.ComputeHash(System.Text.Encoding.UTF8.GetBytes(password)); return computedHash.SequenceEqual(passwordHash); } }
My Db is Mysql 8 with CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci format. Values are stored as varchar(512) so that length is not a problem when saving.
The code for the DB part for saving data is:
Cmd.Parameters.Add(new MySqlParameter("@username", MySqlDbType.VarChar)).Value = user.UserName; Cmd.Parameters.Add(new MySqlParameter("@passwordhash", MySqlDbType.VarChar)).Value = Convert.ToBase64String(user.PasswordHash); Cmd.Parameters.Add(new MySqlParameter("@passwordsalt", MySqlDbType.VarChar)).Value = Convert.ToBase64String(user.PasswordSalt);
The code for retrieving data from db for password check is:
while (Rdr.Read() == true) { user.UserName = Rdr.GetString("username"); user.PasswordHash = System.Text.Encoding.UTF8.GetBytes(Rdr.GetString("passwordhash")); user.PasswordSalt = System.Text.Encoding.UTF8.GetBytes(Rdr.GetString("passwordsalt")); user.UserID = Rdr.GetInt16("userid"); } Rdr.Close();
However when I am doing password match, it is always not matching, could you please help me where I am doing wrong, is it in encoding etc..
VerifyPasswordHash(request.Password, user.PasswordHash, user.PasswordSalt)
learning the code from the tutorial but tutorial is from DB extraction, so want to know if I am doing anything wrong in the process for it to not match.