A practical authorization design for a Salesforce-facing API backed by Snowflake.
An agent clicks a report in Salesforce. The page loads. The API returns 200 OK. Everything appears to work.
Now the harder question: did that agent receive only the records and fields they were allowed to see? A successful response proves the endpoint ran. It says little about whether the caller was authorized for that particular report, customer, or row.
In a banking reporting modernization I worked on, we built role-aware Spring Boot GET APIs backed by Snowflake for agents using Salesforce. This article uses that architecture as an illustrative example. It does not describe a specific client's permission model, incidents, data, or implementation details.

The UI is a starting point, not the final gate
Salesforce can show a report button only to the right users. That improves the experience, but the API must still make its own decision on every request. A caller can reach an endpoint outside the page flow, and an identifier in a URL or filter can point to someone else's record.
OWASP calls this broken object level authorization: an API checks that a user is signed in but fails to check that the user may access the requested object. The same concern applies to report rows and fields. Hiding a button does not authorize a database result.
The design question is therefore not just “Can this role call /reports/exceptions?” It is also “Which exceptions may this agent see, and which columns may be returned?”
Carry an identity the API can verify
A request needs a trustworthy caller identity and a clear link to the agent on whose behalf it was made. The API should validate the token's issuer, audience, expiry, and signature, then map its claims to an explicit policy. A shared service credential may authenticate the integration, but by itself it does not tell the API which human agent requested a report.
The exact integration pattern depends on the organization's identity setup. The key is to document where the user context comes from, who can assert it, and how the API verifies it. Never let an arbitrary request header such as X-Agent-Role: supervisor become the authority merely because Salesforce sent the request. Headers can carry context only when they are protected by a trusted, authenticated boundary and validated against the principal.
Spring Security supports request-level rules and method-level authorization. Use them for distinct decisions: whether a caller can invoke a report type, and whether they can request a particular scope. A filter parameter such as customerId, teamId, or region must be checked against the authenticated principal before it shapes the query.
Make the data layer reinforce the policy
If the application connects to Snowflake through one broad service role, a database policy that checks only that role will see the same role for every agent. It cannot magically infer the human user's permissions. In that setup, the API must enforce the agent's row scope in its query and response logic, and the service role should have the least access it needs.
Snowflake row access policies can add a second control when the session context reliably represents the intended access boundary. Their behavior depends on the role and context available to Snowflake, so test them with the actual connection and role model. Column-level protection may require separate masking or projection rules. Treat database controls and API checks as complementary, with a documented owner for each decision.
For an exception report, a useful policy statement might be: “An agent can see exceptions assigned to their authorized team; a supervisor can see those within their approved region.” This is an example policy, not a claim about a real banking system. Write the rule in business terms first, then translate it into token claims, API checks, query predicates, and database grants.
Test the denial paths, not only the happy path
An authorization test matrix should cover at least:
| Caller and request | Expected result |
| Agent requests their permitted report and scope | Only authorized rows and fields return |
| Agent changes a record or team ID in the URL | Denied or filtered according to policy |
| Agent calls a supervisor-only endpoint | Denied |
| Token is expired, for another API, or missing | Rejected before the report query |
| Role changes after a session begins | Access follows the defined refresh and revocation rules |
Test with different report sizes and roles. Confirm both the HTTP result and the returned data. A 200 OK with an unauthorized row is a failure; so is a 403 that still logs or caches sensitive report content. Review cache keys, exports, pagination, and error messages for the same boundary.
Also record an audit trail of who requested which report scope, when, and whether access was granted without logging customer data or full report bodies. This makes access reviews and production diagnosis possible without creating a second repository of sensitive information.
The release question
When a legacy report moves behind a modern API, the team inherits its access rules as well as its functionality. The release criterion should be specific: every entry point authenticates the caller; every report type checks permission; every supplied identifier is scoped; every query and response honors that scope; and denial cases are exercised in tests.
The most useful review question is simple: If an agent edits one parameter in this request, what stops them from seeing another agent's answer? If the answer is only “the button is hidden,” the authorization boundary is incomplete.
Where have you found the trickiest permission boundary: the UI, the API, or the data warehouse?
References