Morocco's Law 09-08 and authentication: what developers should know
Doha I. · Published · Lire en français

In Morocco, Law 09-08 applies to the data your login system processes (identity, email, IP address, sign-in history). The company that collects it must declare or obtain authorisation for the processing with the CNDP, protect the data, respect people's rights, bind its processors by contract and, if the data is hosted outside Morocco, rely on a country recognised as adequate or obtain the CNDP's prior authorisation.
This article is general information, not legal advice. For your situation, check the official texts and guidance on cndp.ma or ask your legal adviser.
When people think of Law 09-08, they think of customer files and newsletters. They often forget the first personal data an application touches: the user account. A login screen is already personal-data processing.
What data does a login system process?
Even a "simple" login handles:
- identity: name, email address, sometimes a phone number;
- credentials: a password (stored as a hash), MFA factors, passkeys;
- technical traces: IP addresses, device, browser, sign-in times, sessions;
- security events: failed attempts, password resets, anomalies;
- with social login, information coming from Google, Facebook or LinkedIn.
All of this is personal data under Law 09-08.
Who is responsible?
The company that decides why and how the data is collected is the data controller. If you use an authentication provider (Auth0, Firebase, Cognito, SyAuth or another), that provider processes the data on your behalf: it is a processor. Compliance remains your responsibility, and your contract with the processor should set out its security and confidentiality measures.
Declaration or authorisation with the CNDP
The CNDP (Commission Nationale de contrôle de la protection des Données à caractère Personnel) supervises the law. Before you start a processing activity, you generally declare it, and some processing needs prior authorisation. Your filing describes the purpose, the categories of data, the recipients, the retention period and the security measures.
For login, include your authentication provider and where it processes the data.
Data hosted outside Morocco is a transfer
This is the point most often missed. According to the CMS and DLA Piper guides, Articles 43 and 44 of Law 09-08 govern transfers abroad:
- using a service whose servers are abroad means transferring data out of Morocco;
- a transfer is possible to a country that ensures an adequate level of protection;
- otherwise, you generally need the CNDP's prior authorisation, except in the cases the law provides.
Those guides summarise the criminal penalties for an unlawful transfer as up to one year of imprisonment and fines of up to 200,000 dirhams. A reform bringing the law closer to the EU's GDPR has been discussed; follow the CNDP's announcements.
In practice: before you choose an authentication provider, ask exactly where the data is processed and backed up, including support access.
Expected security practices
The law requires appropriate technical and organisational measures. For a login system, that means at least:
- passwords stored only as strong hashes, never in plain text;
- multi-factor authentication offered, and required for sensitive accounts;
- HTTPS everywhere, secure session cookies, protection against brute force;
- logs of sign-ins and administrative actions, with a defined retention period;
- limited, traced administrative access.
Your users' rights
Law 09-08 gives people the rights to information, access, rectification and objection. Your application should let you answer these requests: find an account, correct its details, and delete or deactivate an account and its sign-in data when justified.
Checklist for your project
- List the sign-in data you collect and why.
- Choose a retention period for sign-in logs.
- Identify your authentication provider and the country where it processes data.
- If it is outside Morocco: check the country's adequacy or prepare the CNDP authorisation request.
- Sign a processing agreement with security commitments.
- File your declaration or authorisation request with the CNDP.
- Turn on MFA, strong hashing and logging.
- Plan how you will answer access, rectification and objection requests.
Where SyAuth fits
SyAuth is an authentication platform built in Morocco by Nexorix. It cannot make you compliant on your behalf, no provider can, but it helps you complete your file: the team answers your questions about where data is processed, the security measures and the contractual terms, in French or English. Technically, SyAuth provides MFA, passkeys, audit events and session management.
To discuss it before you sign: nexorix.com/contact-us. To learn about the product: SyAuth, built in Morocco.