What to build and what to reuse in your SaaS

By DavidPermissions

Sign-in is usually the first decision. The harder questions arrive when someone belongs to two customer accounts, an administrator needs to invite teammates or a departing contractor still has an API key.

At that point, choosing an auth service also means choosing how much identity, access and operating work your team will maintain.

Compare the work that remains

There are three broad approaches. Individual products differ, so use this as a starting point for evaluating a specific service:

ApproachWork you take onA reason to choose it
Build from cloud primitivesIdentity flows, permission behavior, admin tooling, testing and operationsA requirement needs custom behavior you can justify maintaining
Use a vendor-hosted serviceIntegration, account mapping, business rules and handling service failuresYour team wants the vendor to operate the service and its model fits your app
Deploy a service into your AWS accountIntegration plus the account, access and operating responsibilities in the service agreementAccount ownership and infrastructure inspection are requirements worth the extra responsibility

A hosted service can be a sensible choice. If it covers your workflows and your team does not want to operate that infrastructure, putting it in your own AWS account may add work without solving a current problem.

For a customer-account deployment, ask who handles upgrades, responds to incidents and recovers the service. Resource ownership alone does not answer those questions.

Test your account model before committing

A useful evaluation is one contractor working for two customers. Give her edit access in one customer and read access in the other. Then remove the first assignment while keeping the second usable.

That small scenario reveals several integration requirements:

  • Can one identity belong to both customers?
  • Can access be assigned to one project rather than the whole account?
  • What can a customer administrator grant?
  • What happens to an existing session and personal API keys after removal?

Walk through these operations using the product's documented interfaces. Record the application code you need around them. A sign-in demo cannot answer all four questions.

Keep application rules in the application

Reusable permissions still need context from your product. For an edit, your backend verifies the session, loads the target record, finds its actual customer and project, and requests an access decision. It then checks application rules and saves the change if both permit it.

The idea, picturedReusing authorization still leaves work in your application.
01Verify sessionApplication02Resolve brief scopeApplication data03Evaluate accessPermission service04Validate & saveApplication, if allowed01Verify sessionApplication02Resolve brief scopeApplication data03Evaluate accessPermission service04Validate & saveApplication, if allowed

The application establishes identity and resource context, requests an access decision, then validates and carries out the business action only when allowed. An access decision does not validate the edit.

For example, permission to edit a brief does not decide whether a finalized brief may be reopened. That rule belongs with the workflow. Expect to maintain it whichever approach you choose.

Evaluate the operating boundary

For hosted services, inspect the outage behavior, billing model, identity export and migration path. For services in your account, inspect deployment authority, runtime dependencies, update procedures and recovery access. For custom code, identify who will maintain those same responsibilities internally.

saaslayer's controlled beta focuses on deploying Users and Permissions into your own AWS account through CloudFormation. The deployment guide describes that path. It is worth evaluating when control of the AWS account is part of your requirement.

Write down what your team will own after adoption and run the contractor scenario against it. That comparison is more useful than counting how many features appear on the first sign-in screen.