A complete authentication design answers more than “Can this visitor log in?” It explains what happens after sign-in, how returning customers recover their work, how private records are protected, and how old accounts connect to a new system.
This guide develops that architecture and an illustrative membership-service design. For the customer experience and product-fit decision, read choosing passwordless website login. For method-level implementation, use the authentication API integration guide.
Separate authentication, authorization and saved state
Authentication establishes that there is a valid signed-in session. Authorization decides whether that session may perform a particular action on a particular resource. Saved state remembers information such as a chosen theme or a bookmarked lesson. These have different purposes even when they appear together on one account screen.
A customer can be signed in without being a paying member. A paying member can be allowed to open one workshop but not another. A workshop owner can manage its content without receiving permission to view every customer's private records. Write these distinctions into the product design before building the interface.
The basic visitor journey still has four jobs: offer hosted popup sign-in, confirm the current session, restore the project's saved information for that account, and provide visible sign-out. Add the permission decision wherever the visitor requests a restricted resource or action.
Hiding an administrator button is a presentation choice, not the enforcement of an access rule. OWASP's authorization guidance recommends least privilege, denying access by default, checking permission on every relevant request, and enforcing the decision in a trusted service rather than relying on browser controls.
Define the account and data boundaries
Gammal Tech does not disclose the signed-in account's underlying name, email address, phone number, National ID number, or identity documents to your application. Session verification is not an identity lookup. The project can retrieve only information it previously saved for that account.
Each person has one Gammal Tech account, reusable across participating websites. Verification uses the National ID of a country whose citizenship the applicant holds, not an ID issued solely for residence. The exceptions are an Egyptian passport for Egyptian citizens abroad without their Egyptian National ID available, and an Egyptian birth certificate for Egyptians in Egypt under 15 who have neither an Egyptian National ID nor a passport.
If your website asks for a display name, preference, or contact detail through its own form, your business collects that information separately. A name entered in such a form is not a verified identity attribute supplied by Gammal Tech.
The login token changes on each login and is not a stable customer identifier. Persistent project data remains associated with the same account despite that change. Keep those concepts separate when choosing database keys or designing a migration; the current token must not become your permanent customer record key.
Sessions are kept per browser tab, and a fresh tab or reopened browser requires sign-in again. Signing out clears the local session while saved project data remains available after the same account signs in again. The web authentication lifecycle guide explains session and saved-data behavior in detail.
Assign a clear owner to each responsibility
| Area | Responsibility and boundary |
|---|---|
| Account sign-in | Gammal Tech supplies the hosted popup flow. Your application does not maintain a customer password table for it. |
| Session experience | The SDK supports session confirmation and local sign-out. Your interface reflects the current state and protects sensitive views. |
| Personal project data | Gammal Tech stores up to 1 MB per user. Your app chooses the data structure and retrieves only what its project previously saved. |
| Business permissions | Your product defines and enforces the rules for paid features, private records, ownership and administrative work. |
| Domain configuration | The owner registers up to four HTTPS domains. Browser API access uses a public project identifier and domain whitelisting, without a secret API key. |
| Operations | Your team plans customer support, domain changes, project funding, migration, and testing of its complete application. |
Personal storage can hold settings, reading lists, and learning progress. It does not by itself supply a shared customer database, an administrator dashboard, or a migration of historical records. If your product needs those capabilities, include their design and operation in the project scope.
Domain whitelisting belongs to project configuration. A valid registered domain does not tell your application whether a particular visitor owns an order or may change a price. Similarly, the absence of an API secret does not make session tokens public information.
An illustrative architecture for a workshop membership service
Consider a service with public workshop descriptions, personal bookmarks, paid workshop access, and a small editorial team. The following is a design specification for that product, not a claim that a complete membership engine comes built into the login SDK.
1. Keep the public experience useful
Visitors can read workshop descriptions without signing in. The page requests login when they want to save a workshop or use an account feature. The application explains the benefit at that point rather than treating every page as private.
2. Restore personal preferences after sign-in
After confirming the session, the application loads the project's saved bookmarks and last-viewed lesson. Those values personalize the screen. They do not establish that a workshop was purchased, because remembering a choice and proving an entitlement are separate jobs.
3. Keep authoritative decisions in trusted records
For each paid workshop, define the trusted purchase record, the owner of the entitlement, and the conditions that make it active or inactive. A browser-editable value such as “paid: true” is insufficient. So is an unverified customer reference placed in personal saved data.
If the service has its own private backend, demonstrate how it securely associates the current authenticated customer with the correct business record. The changing session token and the absence of an identity lookup must be accounted for. Confirm the supported integration before relying on the design; a successful browser login alone does not solve that association.
4. Apply the rule to the requested resource
When the customer requests lesson materials, the trusted component checks that the relevant entitlement allows that particular workshop. An editor receives the separate permissions required to edit assigned content. A generic “signed in” flag is not enough for either decision.
5. Define the end of access
Decide what happens when a membership expires, a purchase is reversed, or an editor leaves the team. The authoritative permission changes, and subsequent protected actions follow the new decision. The reading preference may remain, but it cannot override the withdrawn permission.
If the product cannot yet demonstrate a trustworthy association with an existing private backend, launch the verified personal features first and retain the established access process for sensitive records. Expand access only when the complete association and permission checks have been validated.
Turn the design into an access matrix
Describe access in terms of resources and actions, not just screen names. The matrix below is an example policy for the workshop service; a different business should define its own rules.
| Action | Required decision |
|---|---|
| Read a public workshop description | Public access; no account required by this example product. |
| Save a personal bookmark | A valid session for the account whose project data is being saved. |
| Open paid workshop materials | A valid authenticated association and an active entitlement for the requested workshop. |
| Edit workshop content | A separately assigned editor permission covering that workshop. |
| Change another customer's access | An explicitly authorized administrative action, supported by a recorded business reason. |
Have the product owner review this table with the developer. If the owner cannot explain why a role needs an action, the rule is not ready to become a default permission. Avoid treating all registered customers as staff or all staff as administrators.
Plan account migration before replacing the old login
Start by identifying what already exists: customer records, paid entitlements, preferences, and the old system's evidence of account ownership. Separate records that can safely be re-entered from records whose ownership must be proved. A favorite color and an existing paid subscription do not have the same migration requirements.
- Inventory the records and permissions. List what must survive the change and where the authoritative version currently lives.
- Define ownership proof. For an old private account, use a reviewed process based on trustworthy evidence of access to that account. Do not match solely on a display name or a contact detail typed into an unverified form.
- Prove the new association. Specify and validate how the new session reaches the correct existing record without relying on a permanent Gammal Tech identity identifier or an undisclosed email address.
- Handle ambiguity explicitly. Decide how support resolves conflicting records or an interrupted linking process. Do not merge records silently because their names look similar.
- Pilot and preserve a recovery path. Move a limited group through the complete journey before withdrawing the old access process.
Customers use their existing Gammal Tech accounts; the migration must not ask them to create a second account. Historic passwords, customer records, and business roles do not transfer automatically.
For project setup, the owner uses a verified account, creates a project in the Developer Console, and registers the website's HTTPS domains. Register bare and www versions separately if both are used. Include production and other required origins in the four-domain plan.
Validate the whole system before rollout
Test the customer journey and the access policy together. Cover sign-in cancellation, the first visit with no saved data, an ordinary returning visit, another device, a fresh browser tab, and sign-out. The visible page should match the actual session state and clearly distinguish a failed load from an empty account.
For protected resources, include negative tests: an ordinary customer requests an administrative action; one customer requests another customer's record; an expired membership requests paid material; and a browser-edited preference claims a paid status. The application should refuse access according to the defined policy.
Also test a failed verification dependency. If the product cannot establish a required permission, it should not improvise access. Show a useful, non-sensitive customer message and keep diagnostic details out of the public response. Confirm the recovery path before launch, along with ownership of support and operational alerts.
These checks complement the SDK contract and integration tests. A working login call is an input to the system review, not the completion of it.
Budget for authentication and the application around it
Login, logout and session verification have unlimited free use. User data storage is also free within the 1 MB per-user limit. The first project is free; additional projects have a one-time fee shown in the Console.
Login and checkout identity-verification codes share an allowance of 200 OTP codes per project per month, resetting monthly. Each additional code costs 0.40 EGP. Add funds to the personal account wallet, then transfer them into the project balance. Paid OTP operations require available project funding and stop when that balance is exhausted.
Historical currency illustration: The earlier article's approximate US$0.0077 per additional code used USD 1 = EGP 51.78, the midpoint previously recorded from Banque Misr's buying and selling rates on 24 September 2026. It is not a current exchange-rate quote. EGP is the billing amount; your provider's rate and fees may differ.
Include your own implementation, business-rule enforcement, migration and support effort in the overall budget. The Firebase pricing comparison examines provider billing models, while the authentication-code pricing guide focuses on messaging costs.
Common architecture questions
Can I match an existing customer by their verified email?
The login service does not disclose the underlying account email or identity documents. Plan a separately verified linking process for existing business records. A display name or contact address entered into your own form is not enough to prove ownership of an older account.
Where should membership and payment status live?
Keep the authoritative decision in the trusted business system that manages those records. The customer can use project storage for preferences and compact progress, but an editable value such as paid: true must not grant access by itself.
What can carry over when a customer changes devices?
After the same account signs in, the project can retrieve its previously saved information. Business access still depends on your separately enforced rules. The changing session token is a sensitive credential, not a permanent field for joining customer records.
Does sign-in automatically grant administrator access?
No. Administrative access comes from your application's separately enforced authorization rules, not from account registration, verification, or a preference stored by the visitor.
References and scope
Product facts were checked against published documentation on 14 October 2026. The workshop example, access matrix and migration plan are application-design recommendations; they do not describe an automatic membership or account-linking feature.
- Gammal Tech integration reference: account setup, private project data, domains, session handling and funding.
- OWASP Authorization Cheat Sheet: separation of authentication and authorization, least privilege and trusted access checks.