Authentication

Auth

المصادقة (Authentication)

GLS-000166

Beginnerauth-security1 min read
authloginsign insign-inuser loginuser authenticationidentity verificationauthn

Definition

Verifying that a user is who they claim to be — the 'who are you?' step before granting access.

التحقق من أن المستخدم هو من يدّعي أنه — خطوة 'من أنت؟' قبل منح الوصول.

Why It Matters

Without authentication, anyone could access private content, bookmarks, notes, and admin features. Every protected feature on 404Fault — learning progress, bookmarks, the admin panel — requires a verified identity first.

بدون المصادقة، يمكن لأي شخص الوصول إلى المحتوى الخاص والإشارات المرجعية والملاحظات وميزات الأدمن. كل ميزة محمية في 404Fault — تقدم التعلم والإشارات المرجعية ولوحة الأدمن — تتطلب هوية مُتحقَّق منها أولاً.

Full Definition

Authentication is the process of verifying a user's identity. Before an app grants access, it must confirm that the person logging in is who they say they are. Common methods include email + password, Google Sign-In, GitHub OAuth, magic links, and phone OTP. Authentication answers 'Who are you?' — Authorization (a separate concept) then answers 'What can you do?'. On 404Fault, Firebase Authentication handles all user identity management: creating accounts, signing in, issuing ID tokens, and refreshing sessions.
المصادقة هي عملية التحقق من هوية المستخدم. قبل أن يمنح التطبيق الوصول، يجب التأكد من أن الشخص الذي يسجّل الدخول هو من يدّعي. تشمل الطرق الشائعة: البريد الإلكتروني وكلمة المرور وتسجيل الدخول بجوجل وGitHub OAuth وروابط الدخول السحري ورمز OTP. المصادقة تجيب على 'من أنت؟' — التفويض (مفهوم منفصل) يجيب على 'ماذا يمكنك فعل؟'. في 404Fault، تتولى Firebase Authentication إدارة هوية المستخدمين: إنشاء الحسابات وتسجيل الدخول وإصدار رموز الهوية وتجديد الجلسات.

Example Usage

Firebase Authentication's onAuthStateChanged() listens for sign-in state changes and keeps the React AuthContext updated across every page.

مستمع onAuthStateChanged() في Firebase Authentication يتابع تغييرات حالة تسجيل الدخول ويحافظ على تحديث AuthContext في React عبر كل الصفحات.

Knowledge Graph

Avoid these mistakes when using Authentication:

1

Confusing authentication (who you are) with authorization (what you can do)

2

Only checking auth on the frontend — always verify the ID token server-side

3

Storing the Firebase ID token in localStorage instead of a secure HttpOnly cookie

Sign in to unlock guided AI explanations from AI Teacher.

Generate a Prompt

Copy this prompt and use it directly with any AI model — no setup needed.

Ready-to-Use Prompt
Help me build a project using Authentication.

Explain:
1. What is Authentication and why it matters
2. The core architecture and required tools
3. Step-by-step implementation plan
4. Common mistakes to avoid: Confusing authentication (who you are) with authorization (what you can do), Only checking auth on the frontend — always verify the ID token server-side, Storing the Firebase ID token in localStorage instead of a secure HttpOnly cookie
5. Best practices and production tips

Official Resources