Closed tahademirer closed 3 years ago
Yes you can
What you need is to use Custom Identity Provider
As for the start point - please check the following links:
Please let us know if you have any difficulties
You also may find interesting the following issue https://github.com/ConnectyCube/connectycube-reactnative-samples/issues/80
Thanks for your quick answer. I'll follow the articles you attached and let you know if I have any other trouble about this.
Hi again! I read your documentation and I want to say it's very good! Thanks for your fine work. I have another question. The doc. says that I should enable Firebase Phone Authentication. Can I use E-Mail Authentication instead of Phone? Thank you for your answer. Stay healthy!
If you want to use Firebase E-Mail Authentication instead of Phone then just refer to https://github.com/ConnectyCube/connectycube-reactnative-samples/issues/162#issuecomment-739894218
for this you do not need to enable Firebase Phone Authentication.
**Hi again Dave! Sorry for my infinite questions. I'm just a beginner. When I read the doc about "Custom Identity Provider" I realized that some of points are not clear enough for me. This is my Firebase login function which works via React-Redux. I'm using this POST request for verify my users. I want to understand a few things: 1- What should I write to API URL section at my admin panel? Should I write the URL in my POST action below? 2- After ConnectyCube API URL and parameters part is done, what should I do with the token from my database? Should I write a new POST method and send it to ConnectyCube? If it is, Which URL? ( Is https://api.connectycube.com/login enough?)
Thank you!**
`export const login = (email, password) => { return async (dispatch) => { const response = await fetch( "https://identitytoolkit.googleapis.com/v1/accounts:signInWithPassword?key=[myAPIKey]", { method: "POST", headers: { "Content-Type": "application/json", }, body: JSON.stringify({ email: email, password: password, returnSecureToken: true, }), } ); if (!response.ok) { const errorResponseData = await response.json(); const errId = errorResponseData.error.message; let message = "Bir şeyler ters gitti."; if (errId === "EMAIL_NOT_FOUND") { message = "Bu E-Posta ile kayıtlı kullanıcı bulunamadı."; } else if (errId === "INVALID_PASSWORD") { message = "Girmiş olduğunuz şifre hatalı."; } throw new Error(message); } const resData = await response.json();
dispatch({ type: LOGIN, token: resData.idToken, userId: resData.localId });
}; };`
Re 1 - the following should be done:
https://identitytoolkit.googleapis.com/v1/accounts:signInWithPassword?key=[myAPIKey]
POST
{"Content-Type": "application/json"}
{"email": "#{email}", "password": "#{password}", "returnSecureToken": "true"}
{"uid": "#{localId}"}
Re 2 - you should call /login API and pass your user 'email' and 'password' field
Dave, you are the best. What a quick support and answer! I'll try it. Thank you!
Hi again Dave! Your answer totally worked for me. Amazing! When I publish my app, I'll send you a box of Turkish Delight from Turkey! :) Thanks!
I have users in my firebase db. Can I integrate them with ConnectyCube? If I can, how? Thanks!