
Learn to implement Google sign-in with a REST API without Firebase, configure the Google service plist, and set up client IDs for backend and iOS in a Flutter project.
install essential flutter packages for http requests, secure storage, app information, provider state management, and Google sign in using flutter pub add in the terminal.
Configure api settings and Google sign-in in a Flutter app using REST API and JWT; securely store tokens with Flutter Secure Storage and manage authentication state with change notifier.
In this tutorial, i will build a Flutter app that allows users to sign in with their Google accounts, leveraging a REST API built with Symfony framework for authentication and JSON Web Token management.
When a user signs in through Google, our system will check if the user already exists in our database. If not, it will create a new user account. Once authenticated, either as a new or existing user, our application will generate a JSON Web Token.
This JSON Web Token is securely stored using flutter_secure_storage and allows the Flutter app to send requests and access resources.
We will be using several essential Flutter packages:
dio for making HTTP requests to our REST API.
flutter_secure_storage Flutter Secure Storage provides API to store data in secure storage. Keychain is used in iOS.
package_info_plus to access app information.
provider for state management.
google_sign_in Flutter plugin for Google Sign-In, a secure authentication system for signing in with a Google account.
Enable the OAuth APIs that you want, using the Google Cloud Platform API manager.
Enable the OAuth APIs that you want, using the Google Cloud Platform API manager. Make sure you've filled out all required fields in the console for OAuth consent screen.