đŻ SaaS dev challengesâ-â#02 đ ď¸Authentication
- Date
- Author
- Alexandro MartĂnez@AlexandroMtzG
In my previous post, I talked about how UI/UX is a challenge you face right after you start your SaaS. TLDR: Use an existing UI library like Tailwind UI, have your components documented (like this), and get inspiration from other SaaS websites, but always add your own UI/UX style.

âTLDR:
- 1â-âWhy should we authenticate our users? Itâs in their best interest.
- 2â-âObligatory auth pages: login, register, and forgot.
- 3â-âOptional auth pages: invitation link, magic-links⌠(better UX đđ¤).
- 4â-âShould you build your own auth system? Yes.
- 5â-âShould I use a commercial Auth/Authorization provider? No.
- 6â-âLet your users test the app then ask them to register đđ¤).
- 7â-âShould I add Authorization logic? At least identify the userType.
Remember these takeaways are based on my experience.
â1/7â-âWhy should we authenticate our users?
Every SaaS applicationâs main goal is to grow its MRR, so the easy answer would be âto charge our usersâ for using our app.
But really, whatâs the real reason we should authenticate our users?
Imagine our previously created invoice form:
Our unauthenticated user đ¨ creates a quote (/quote/cl2d1lgc4000909) and sends the PDF to their client đŠ.
3 days later, the client đŠ asks for a quote modification.
Our unauthenticated đ¨ user realizes he closed the browser and did not write down the quote-URL (/quote/cl2d1lgc4000909). So he creates the quote again, from scratch.
Of course, you could include the quote-URL in the email, but thatâd be a horrible user experience for future quotes. So itâs in their best interest to be identified on every page reload and show them all their data (even if they donât realize it).
Authentication is on every SaaS applicationâs core system, so we either come to terms with it or suffer every time weâre building our next SaaS app idea.
â2/7â-âObligatory auth pages
Every auth system needs at least a Log-in page, a Sign-up page, and a Forgot-password page.

Itâs up to you to decide what to customize, for example, you could:
- Loginâ-âAdd 2FA.
- Registerâ-âSend an activation email.
- Forgotâ-âAsk for a secret question or Captcha.
But I suggest you follow these principles when signing up new users:
- Ask for as little information as you can (maybe just email and password).
- Donât ask for a credit card, youâll scare away a lot of leads.
- Assume your users will add â e M a il sliKE@thisone.com â.
â3/7â-âOptional auth pages
Weâre trying to build a great user experience, these are 2 things you could add:
â1) Let your tenants invite their members.
Your register page should be for Tenant Admins, not Tenant Users.

â2) Make a simple referral program system.
Whatâs an incentive you can give to a customer to invite other users? Use your imagination but it could be: new customer subscription share, fixed $$$ pro-featuresâŚ

This would expand your customer acquisition strategy, and remove the friction of asking every user to visit the /register page first.
â4/7â-âShould you build your own auth system?
Letâs get real here. You will probably build more than one SaaS application in your career, so learn the fundamentals, keep it simple, and build your own authentication system because youâll reuse it on every one of them: /login, /register, /forgot-password, /reset-password, /invitation-link, /magic-linkâŚ
â5/7â-âShould I use a commercial Auth provider?
Of course, you could use Auth0, or Okta, but auth design/dev is not hard as it appears to be, especially in 2022. And why keep your data on a third party? You canât control what you donât have.
Itâs better to add social account integrations for app features, not app authentication (eg: after a user signs up, let them integrate connect their Instagram account to load all of their photos).
âWhen to use third-party Auth systems?
Donât try to build your auth system from scratch when:
- Youâre just testing a quick MVP.
- Youâre building a B2C application where youâll most likely need many of their supported social identity providers: Instagram, Twitter, Gmail, Facebook, Apple, Microsoft Account, LinkedIn, GitHub, Dropbox, Paypal, Basecamp, Salesforce, Shopify, Evernote, Discord, Figma, Slack⌠you get the point.
â6/7â-âLet your users test the app, then ask them to register
There are a lot of things a user will think about before subscribing to your SaaS. Donât give them a reason to leave. Let them test your application before you ask them to register.
To use the invoicing app as a reference:
- Add a /create| URL to let the unauthenticated user create an Invoice.
- Warn your users that they will be asked to register when exporting the invoice PDF.
- Save the invoice to an âunauth-invoiceâ database table.
- Does the user want to export it as PDF? Ask them to register first.
- Did the user sign up? Transfer the invoice to the âinvoiceâ table, where thereâs a tenantId property.
But be careful, we all hate when we get deceived by a website (eg: The app lets me design something for 1 hour, but I cannot download it unless I pay $25). So let your unauthenticated users what they wonât be able to do if they donât sign up or pay after a certain point in their application use.
â7/7â-âShould I add Authorization logic?
Start with something as simple as:
- User is an admin? Redirect to /admin
- User is a tenant? Redirect to /app
- User is a tenant and wants to access /admin? Redirect to /401
But plan for some authorization logic in your pages:
- /app/:tenant/settings/organization should be for TenantOwners only.
- /app/:tenant/settings/subscription should be for TenantAdmins only.
- /app/:tenant/contracts should be for TenantMembers only.
- /app/:tenant/public-contracts should be public (for unauthorized users).
âConclusion đ§âđŹ
Thatâs it for this section, I hope you found it useful in some way. Remember to take with a grain of salt đ§ every Auth post/tip out there, especially this one.
Now that we identified our users, letâs charge them to use our SaaS on a monthly/yearly basis đ¤. Stay tuned for the next 5 planned posts:
- #03â-âđ¸ Pricing (subscriptions, payments, cardsâŚ)
- #04â-âđŠâđź Admin (tenants, dashboard, Helpdesk, CRM, API keysâŚ)
- #05â-ââď¸ Settings (profile, members, permissions, dashboard, API keysâŚ)
- #06â-âđŹ Landing (GDPR, multi-language, dark mode)
- #07â-âđŚ The Actual SaaS Application