Data API Builder - Azure Static Web Apps

JohnM 25 Reputation points
2024-10-31T00:28:08.82+00:00

Trying to understand Data API Builder (DAB) and if its right for my use case.

Based off a simple address book example, there is a table "Addresses" that would have columns:

  • User (the user of the address book, likely an ID linked from a User table)
  • Name
  • Email Address

In a standard web application (front end + back end) to get a list off all addresses belong to the app User, a back end function would take a User ID (de-crypted from the User authentication) and return all address linked to the User.

In the DAB example, the front end will be filtering/querying the address table based on the User ID same as above.

But what is to stop a hacker just incrementing User ID's and extracting all address from the entire table or not even adding the the User ID to the query filter and getting the entire Address table?

The standard web app above has authorization to make sure only the User's Addresses are returned.

Are my assumptions correct?

Are there solutions to fix this?

  • How do you make sure its only possible to return address linked to the the authorized User only?
  • Use a GUID for User ID and expose only a Stored Proc to DAB?
Developer technologies | .NET | Blazor
Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.