Posts

Showing posts with the label Firebase Authentication

How to make Firebase query search not case sensitive #18

Image
How to make Firebase query search not case sensitive because you know Firebase provide exact match "==" with case sensitive. So we will solve this issue in the chapter in detail. We will use the Laravel PHP SDK for the firebase for all the queries stuff. Also we will see case insensitive sorting with Firebase orderBy using Firebase search ignoring case. Now lets consider a simple example, you have 'Student' list and you want to search by name. So the main use of any search is that, you insert one or two characters and the system should search the most matching one, but that not the case in Firebase. Firebase is a case sensitive. Means string "Name" and "name" are two different values for Firebase. All Firebase developers are facing this issue, which is most basic necessity. So lets first understand, currently what is provided by Firebase. See the below example of Student List. Now here you see, we have a Student ...

Chapter 15 - Laravel with Firebase Sign In and maintain logged in session using middleware

Image
In this chapter, we will learn how can we implement a login page and make a user login. Then maintain a session for other page queries and logout to destroy session. Before we start, we assume you have all knowledge of setting up the Firebase Authentication. If not please read this  Chapter 6 First of all, below is the code of login method with takes email and password and checks if the credentials is correct or incorrect. try { $logged_user = app('firebase.auth')->verifyPassword($request->emailaddress, $request->password); //Credentials are correct } catch (\Kreait\Firebase\Exception\Auth\InvalidPassword $ex) { return back()->withErrors(['Credentials are incorrect']); } Now if Credentials are correct, then store the uid in the Laravel Session \Session::put('uid', $logged_user->uid); Now create a custom middleware. lets us name it as 'firebase...

How to use firebase reset password custom and manage & reset forgotten users passwords - #14

Image
Learn how to use custom firebase reset password and manage & reset forgotten users passwords. Detailed how to implement the custom Firebase Auth Forgot/Reset Password template and send to user on Forgot Password Request. And the reset password URL would contain URL to your site instead of Firebase default URL. And on visit of this URL, how to call verify method of Firebase Auth and Form containing password fields submission in Laravel PHP with little help of JavaScript SDK. Here, before we start, please read this Email verification chapter  https://laravelwithfirebase.blogspot.com/2020/04/chapter-13-implement-custom-firebase-auth-email-verification-template-replace-default-view-using-laravel-php.html Most of below content would be same. Now lets begin to customize the URL, you get in your firebase email verification template. It looks like something  https://test-cc4d3.firebaseapp.com/__/auth/action?mode=<action>&oob...

How to create custom firebase email templates and action handlers link #13

Image
Learn how to create custom email action handlers and change the Firebase email templates using Firebase email link authentication. Detailed how to implement the custom Firebase Auth Email verification template and send to user on signup. And the verification URL would contain URL to your site instead of Firebase default URL. And on visit of this URL, how to call verify method of Firebase Auth in Laravel PHP with little help of JavaScript SDK. Here, we assume, your are clear about Firebase Auth and you have enabled the Email/Password in the Sign-in method Now lets begin to customize the URL, you get in your firebase email verification template. It looks like something  https://test-cc4d3.firebaseapp.com/__/auth/action?mode=<action>&oobCode=<code> Here, in above image, you have edit button for the editing the template. Click on that, then you will have "customize action URL" link at the bottom...

How to use Laravel with Firebase authentication using REST API basic integration #6

Image
Learn how to use Laravel with Firebase authentication using REST API basic integration. In this chapter, we will learn how to setup authentication in Firebase and its usage in the Laravel using the Firebase Admin PHP SDK. First of all, click on "Authentication" and open the "Users" tab, click on the "Set up sign-in method". It will redirect to Sign-in method tab. Then click on status "Disabled" on "Email/Password" row and "Enable" this option. Keep the "Email link (passwordless sign-in)" is disable. We will cover in next chapters. Click on "Save" and make this option "Enabled". This will give you option to add users in "Users" tab. Now if you add a user, it will provide a unique user id and can link it with any collection in the Cloud Firestore database by inserting this uid in the fields and can add...