একটি কাস্টম প্রমাণীকরণ সিস্টেম ব্যবহার করে ফায়ারবেসের সাথে প্রমাণীকরণ করুন
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
কোনো ব্যবহারকারী সফলভাবে সাইন ইন করলে আপনি কাস্টম সাইনড টোকেন তৈরি করতে আপনার প্রমাণীকরণ সার্ভারকে সংশোধন করে একটি কাস্টম প্রমাণীকরণ সিস্টেমের সাথে Firebase প্রমাণীকরণকে একীভূত করতে পারেন৷ আপনার অ্যাপটি এই টোকেনটি গ্রহণ করে এবং Firebase এর সাথে প্রমাণীকরণ করতে এটি ব্যবহার করে৷
আপনি শুরু করার আগে
- যদি আপনি ইতিমধ্যেই না করে থাকেন, তাহলে শুরু করুন গাইডের ধাপগুলি অনুসরণ করুন৷
- Firebase অ্যাডমিন SDK ইনস্টল এবং কনফিগার করুন । আপনার Firebase প্রকল্পের জন্য সঠিক প্রমাণপত্র সহ SDK আরম্ভ করতে ভুলবেন না।
Firebase দিয়ে প্রমাণীকরণ করুন
যখন ব্যবহারকারীরা আপনার অ্যাপে সাইন ইন করেন, তখন তাদের সাইন-ইন শংসাপত্র (উদাহরণস্বরূপ, তাদের ব্যবহারকারীর নাম এবং পাসওয়ার্ড) আপনার প্রমাণীকরণ সার্ভারে পাঠান। আপনার সার্ভার শংসাপত্রগুলি পরীক্ষা করে এবং যদি সেগুলি বৈধ হয়, একটি কাস্টম ফায়ারবেস টোকেন তৈরি করে এবং টোকেনটি আপনার অ্যাপে ফেরত পাঠায়৷
আপনি আপনার প্রমাণীকরণ সার্ভার থেকে কাস্টম টোকেন পাওয়ার পরে, ব্যবহারকারীকে সাইন ইন করতে signInWithCustomToken()
এ পাস করুন:
try {
final userCredential =
await FirebaseAuth.instance.signInWithCustomToken(token);
print("Sign-in successful.");
} on FirebaseAuthException catch (e) {
switch (e.code) {
case "invalid-custom-token":
print("The supplied token is not a Firebase custom auth token.");
break;
case "custom-token-mismatch":
print("The supplied token is for a different Firebase project.");
break;
default:
print("Unknown error.");
}
}
পরবর্তী পদক্ষেপ
কোনও ব্যবহারকারী একটি নতুন অ্যাকাউন্ট তৈরি করার পরে, এই অ্যাকাউন্টটি আপনার Firebase প্রকল্পের অংশ হিসাবে সংরক্ষণ করা হয় এবং ব্যবহারকারী যে সাইন-ইন পদ্ধতি ব্যবহার করেন তা নির্বিশেষে আপনার প্রকল্পের প্রতিটি অ্যাপ জুড়ে একজন ব্যবহারকারীকে সনাক্ত করতে ব্যবহার করা যেতে পারে।
আপনার অ্যাপে, আপনি User
অবজেক্ট থেকে ব্যবহারকারীর মৌলিক প্রোফাইল তথ্য পেতে পারেন। ব্যবহারকারীদের পরিচালনা দেখুন।
আপনার ফায়ারবেস রিয়েলটাইম ডেটাবেস এবং ক্লাউড স্টোরেজ সুরক্ষা নিয়মে, আপনি auth
ভেরিয়েবল থেকে সাইন-ইন করা ব্যবহারকারীর অনন্য ব্যবহারকারী আইডি পেতে পারেন এবং ব্যবহারকারী কোন ডেটা অ্যাক্সেস করতে পারে তা নিয়ন্ত্রণ করতে এটি ব্যবহার করতে পারেন।
আপনি একাধিক প্রমাণীকরণ প্রদানকারী ব্যবহার করে ব্যবহারকারীদের আপনার অ্যাপে সাইন ইন করার অনুমতি দিতে পারেন প্রমাণীকরণ প্রদানকারীর শংসাপত্র ) একটি বিদ্যমান ব্যবহারকারী অ্যাকাউন্টে লিঙ্ক করে ।
একজন ব্যবহারকারীকে সাইন আউট করতে, signOut()
কল করুন :
await FirebaseAuth.instance.signOut();
অন্য কিছু উল্লেখ না করা থাকলে, এই পৃষ্ঠার কন্টেন্ট Creative Commons Attribution 4.0 License-এর অধীনে এবং কোডের নমুনাগুলি Apache 2.0 License-এর অধীনে লাইসেন্স প্রাপ্ত। আরও জানতে, Google Developers সাইট নীতি দেখুন। Java হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2025-07-25 UTC-তে শেষবার আপডেট করা হয়েছে।
[null,null,["2025-07-25 UTC-তে শেষবার আপডেট করা হয়েছে।"],[],[],null,["# Authenticate with Firebase Using a Custom Authentication System\n\n\u003cbr /\u003e\n\nYou can integrate Firebase Authentication with a custom authentication system by\nmodifying your authentication server to produce custom signed tokens when a user\nsuccessfully signs in. Your app receives this token and uses it to authenticate\nwith Firebase.\n\nBefore you begin\n----------------\n\n1. If you haven't already, follow the steps in the [Get started](/docs/auth/flutter/start) guide.\n2. [Install and configure the Firebase Admin SDK](/docs/admin/setup). Be sure to [initialize the SDK](/docs/admin/setup#initialize-sdk) with the correct credentials for your Firebase project.\n\nAuthenticate with Firebase\n--------------------------\n\n1. When users sign in to your app, send their sign-in credentials (for\n example, their username and password) to your authentication server. Your\n server checks the credentials and, if they are valid,\n [creates a custom Firebase token](/docs/auth/admin/create-custom-tokens)\n and sends the token back to your app.\n\n2. After you receive the custom token from your authentication server, pass it\n to `signInWithCustomToken()` to sign in the user:\n\n try {\n final userCredential =\n await FirebaseAuth.instance.signInWithCustomToken(token);\n print(\"Sign-in successful.\");\n } on FirebaseAuthException catch (e) {\n switch (e.code) {\n case \"invalid-custom-token\":\n print(\"The supplied token is not a Firebase custom auth token.\");\n break;\n case \"custom-token-mismatch\":\n print(\"The supplied token is for a different Firebase project.\");\n break;\n default:\n print(\"Unknown error.\");\n }\n }\n\nNext steps\n----------\n\nAfter a user creates a new account, this account is stored as part of your\nFirebase project, and can be used to identify a user across every app in your\nproject, regardless of what sign-in method the user used.\n\nIn your apps, you can get the user's basic profile information from the\n`User` object. See [Manage Users](/docs/auth/flutter/manage-users).\n\nIn your Firebase Realtime Database and Cloud Storage Security Rules, you can\nget the signed-in user's unique user ID from the `auth` variable, and use it to\ncontrol what data a user can access.\n\nYou can allow users to sign in to your app using multiple authentication\nproviders by [linking auth provider credentials](/docs/auth/flutter/account-linking)) to an\nexisting user account.\n\nTo sign out a user, call `signOut()`: \n\n await FirebaseAuth.instance.signOut();"]]