What is Frontend-only Authorization (FoAz)?

Frontend-only-Authorization (FoAz) is a method allowing frontend applications to enforce protected access to APIs without requiring a dedicated backend. FoAz allows frontend developers to securely use sensitive resources directly from the frontend, while gating for permissions and without exposing any secrets or sensitive data.
Isn't Frontend Authorization an Oxymoron ?
It sure sounds like it, but no - it works, it's easy, and it's super safe.
The "trick" is that it's frontend-only in the same sense that Serverless has no servers. There is a backend component which actually enforces the access, you just don't have to build it - Permit.io provides it for you - so you can focus on building your awesome app.
What is FoAz Good for ?
Foremost FoAz is about rapid secure app development; specifically there are two core use cases.
-
Access 3rd Party Services
Web applications often consume external services to implement their features; for example an app might use Twilio to send an invite via SMS, Stripe to bill the user, AWS S3 to fetch the user profile, or Mailchimp to notify them of user activities. All of these would require a secret or API token; coupled with the App developers account, and would often cost money to use.
Without FoAz a developer would have to deploy a backend service to accept the frontend requests, verify the session identity, check for permissions, and invoke the external API along with it's associated secret. With FoAz a developer can simply call the external service directly from the frontend, knowing that Permit will verify the identity, check for permissions, and add the needed secrets for them.
-
Adding Authorization on top of Your API