tomazbracic

tomazbracic

Hi,

I would like to find out the best way to start working on a multi-tenant SaaS product involving Elixir’s full-stack.
In the past, I already asked here about authentication and authorization, but without real luck. I am aware of Pow, Guardian, Phx.gen.auth… but somehow I still have a feeling that I will need to develop 2 products. The first one is my idea about Saas, and the second one is something to cover all these things around security.

I was looking into Keycloak, but I would rather avoid another external dependency.

Current tooling gives you the impression that all we have is basic support. Like the majority of products and use-cases would be running backends with minimum support for auth. Am I wrong? I mean I know I am, but I would like to challenge someone to give some useful feedback. Is there any real guide or tutorial or course on topics like Phx.gen.auth…

So I would like to build SaaS and use it as a multitenant platform with all sorts of roles behind and other modern options. And all that to be production-ready.

I would really like to get some guidance on where to go from here.

Thanks, T

First 3 of 3 Posts Switch mode

kartheek

kartheek

I don’t think you need to build anything from scratch, there are many good libraries out there.

You need answer few questions:

  1. How do you distinguish the requests coming from different tenants in you multi-tenant app ? domain name or api key

  2. What auth providers you will have for authentication - google, fb, etc

  3. How will you provide auth through json endpoint or oauth2 web flow?

  4. Few details about what SaaS platform it is or any references to an existing product? (to understand auth requirements)

Guardian is very mature library for security - GitHub - ueberauth/guardian: Elixir Authentication · GitHub .

I have built multi-tenant solution without phoenix auth and pow. They did not even exist back then.

LostKobrakai

LostKobrakai

Can you explain what “all sorts of roles behind and other modern options” is meant to mean? In my experience the reason why authentication/authorization libraries are often such a pain-point is that a library is used, which does handle that “stuff” just not in a way it would align well with project/business requirements – especially when faced with continuous development and maintenance.

stefanchrobot

stefanchrobot

I would be interested to understand more of your needs. What do you mean by multi-tenancy?

I have a simplistic understanding of multi-tenancy basically meaning that the app supports multiple accounts where each account has it’s own set of data including users. At least that’s how my app works. Each table has an account_id column, almost all context functions receive %Account{} as the first argument. I find that manageable, though my app is pretty small. I support username+password authentication plus access token based for the mobile app API. I’m not a fan of generators, but I mostly got my code out of phx.gen.auth.

— All posts loaded —

Where Next? Top

Trending in Questions Top

stjefim
Hello! Suppose you are building workflow (order / task / payment) processing system with the following requirements: Each workflow con...
New
jonnycharles
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
spammy
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
silverdr
Using Phoenix.LiveView.TagEngine as an EEx.Engine is deprecated! To compile HEEx, use Phoenix.LiveView.TagEngine.compile/2 instead. Sta...
New
dli
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app? Looking for hints regarding: Addi...
New
bottlenecked
Hi all, I wanted to ask how the community is dealing with post-release steps. Today we have Ecto migrations, which make sure that the db...
New
roeland
Kia ora, We have been using elixir-google-api to connect to Google Drive. However, with the updates to Tesla due to CVEs this is now bro...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
type1fool
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New
juhalehtonen
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New

We're in Beta

About us Mission Statement