By NHI Mgmt Group Editorial TeamPublished 2025-09-02Domain: Governance & RiskSource: Kong

TL;DR: SMART on FHIR creates a usable identity layer for healthcare apps, but Kong’s analysis shows the real control point is the API gateway, where token validation, policy enforcement, and compliant error handling determine whether FHIR access stays secure and observable. That makes edge enforcement a governance requirement, not an integration convenience.


At a glance

What this is: This is a Kong engineering post arguing that SMART on FHIR deployments need gateway-based enforcement, token validation, and compliant edge responses to secure healthcare API access.

Why it matters: It matters because IAM, API security, and identity lifecycle teams must treat FHIR access as a governed control plane, not just an authentication flow.

👉 Read Kong's guide to SMART on FHIR security with Kong Gateway and Okta


Context

FHIR makes healthcare data exchange more interoperable, but interoperability does not equal secure access. The governance gap is that applications can authenticate successfully while still needing a separate enforcement layer to control scopes, validate tokens, and shape responses before requests ever reach protected health data.

In SMART on FHIR architectures, identity, consent, and API enforcement are split across different control points. That matters for IAM practitioners because the trust decision is no longer confined to login. It extends to token validation, scope enforcement, auditability, and edge response handling across the full access path.

For teams building digital health platforms, the practical question is whether the gateway is a logging layer or an access control layer. Kong’s post argues it must be the latter, which is the more typical requirement in regulated healthcare environments.


Key questions

Q: How should healthcare teams secure SMART on FHIR access at the gateway?

A: Healthcare teams should validate every access token at the API gateway, enforce scopes before backend access, and log each decision centrally. That approach keeps the identity provider focused on authentication while the gateway handles runtime enforcement for PHI and FHIR resources. It also reduces the chance that direct service exposure or inconsistent app logic weakens policy.

Q: When does gateway enforcement become necessary for FHIR APIs?

A: Gateway enforcement becomes necessary when multiple apps, users, and patient-context rules share the same FHIR backend. At that point, access control cannot rely on application code alone because policy drift becomes likely. A gateway gives security teams one place to validate tokens, apply rate limits, and preserve consistent behaviour across services.

Q: What do security teams get wrong about SMART on FHIR authorization?

A: They often assume successful login means the request is safe. In practice, authentication only proves identity at a point in time, while authorization must still be checked against scopes, expiry, and backend policy for each request. Without that separation, a valid token can still be over-broad or misused outside its intended context.

Q: How do you keep FHIR error handling compliant when the gateway blocks traffic?

A: Use response transformation so blocked requests return OperationOutcome resources instead of generic API errors. That preserves the FHIR contract for application developers while still enforcing security at the edge. It also improves troubleshooting because clients receive structured diagnostics rather than an opaque denial.


Technical breakdown

SMART on FHIR launch flow and token exchange

SMART on FHIR combines OAuth 2.0 and OpenID Connect to let third-party apps request scoped access to electronic health record data. The launch sequence redirects the user to an identity provider, obtains consent, and returns a token with approved scopes and patient context. The important design point is that the token is the portable authorisation artefact, not the login event itself. Once the token exists, any downstream service must decide whether the claimed scope, issuer, and expiry still satisfy policy.

Practical implication: treat issued tokens as governed credentials and validate them at the edge before any FHIR backend is reachable.

Why the API gateway becomes the enforcement point

An API gateway in front of FHIR services can intercept requests, validate JWT signatures and claims, check expiration, and block unauthorised traffic before it reaches the backend. That changes the architecture from direct service exposure to mediated access with a single enforcement layer. It also centralises rate limiting, caching, and audit logging. For regulated health data, that central point is where policy becomes observable and consistently applied across apps, users, and environments.

Practical implication: place validation, throttling, and audit controls at the gateway rather than distributing them inconsistently across individual FHIR services.

FHIR-compliant responses at the edge

FHIR expects structured error handling through OperationOutcome resources, not generic API errors. When authentication fails or rate limits trigger at the gateway, response transformation can convert a standard 401 or 429 into a standards-compliant payload. This matters because the edge now participates in interoperability as well as security. The gateway is no longer just refusing traffic. It is also shaping the client experience and preserving API contract consistency when policy enforcement intervenes.

Practical implication: build error transformation into the gateway so denied requests remain standards-compliant and operationally useful.


NHI Mgmt Group analysis

FHIR security fails when teams confuse authentication with enforcement. SMART on FHIR gives applications a standard way to request scoped access, but that does not remove the need for a policy decision at the point of API execution. Kong’s framing is useful because it separates identity issuance from resource access and shows why the gateway, not the app, must become the control boundary. Practitioner implication: healthcare IAM teams should govern the full request path, not the login step alone.

Edge enforcement is now part of identity governance for regulated APIs. Once scopes, token claims, and response handling sit at the gateway, IAM and API security stop being separate programmes. That alignment matters because auditability, rate limiting, and scope validation are all evidence of who was allowed to do what, when, and under which context. Practitioner implication: treat gateway policy as a first-class identity control, especially where PHI or PII is involved.

Standards compliance and control enforcement have to coexist in FHIR platforms. The article shows that secure access is not only about denying invalid requests, but about returning structured, standards-aligned responses that preserve application interoperability. That is an identity governance concern because the control point is also the communication point. Practitioner implication: design for both denial and explainability at the edge, or downstream developers will work around the policy layer.

Gateway-centric FHIR architectures create a reusable model for API identity governance. The same pattern applies wherever third-party apps, scoped tokens, and regulated data intersect. Once teams accept that the gateway is the enforcement layer, they can extend the model to other API domains without rebuilding every service. Practitioner implication: standardise edge policy, not per-application exceptions.

From our research:

  • 80% of organisations report their AI agents have already performed actions beyond their intended scope, including accessing unauthorised systems (39%), inappropriately sharing sensitive data (31%), and revealing access credentials (23%), according to AI Agents: The New Attack Surface report.
  • Only 52% of companies can track and audit the data their AI agents access, leaving 48% with a complete blind spot for compliance and breach investigation.
  • For a broader view of how runtime identity and access decisions are changing, see OWASP Agentic AI Top 10 and how it frames tool-use risk.

What this signals

Gateway enforcement is becoming the practical boundary between identity and API security. As more regulated workflows move through standards like SMART on FHIR, teams will need one place to validate tokens, apply scope checks, and preserve standards-compliant errors. The programme signal is clear: edge policy will matter more than app-by-app security exceptions.

This pattern also aligns with the broader shift toward governed access paths rather than isolated authentication events. If your identity programme cannot prove who accessed what data, through which token, and under which policy, it is missing the control point that regulators and auditors increasingly care about.

For teams tracking the move from human-only access to machine-mediated access, the lesson extends beyond healthcare. The same gateway-first model supports workload identity, API governance, and future agentic access patterns, especially where third-party apps sit between users and sensitive data.


For practitioners

  • Enforce token validation at the edge Require every FHIR request to pass signature, issuer, expiry, and scope checks in the API gateway before it can reach backend services. Keep the validation logic central so app teams cannot bypass it with direct service access.
  • Map FHIR scopes to explicit access policy Review the scopes your SMART on FHIR apps request and tie each one to a documented business purpose, data class, and patient-context rule. Remove broad or ambiguous scopes that cannot be defended in audit or consent review.
  • Transform gateway failures into OperationOutcome Configure the gateway to convert authentication failures, expired tokens, and rate-limit responses into FHIR-compliant OperationOutcome messages so client applications receive consistent, standards-based errors.
  • Centralise audit logging for PHI access Log every validated request, denial, and policy decision at the gateway, then forward those records into your monitoring stack for correlation with identity events and patient data access reviews.

Key takeaways

  • SMART on FHIR improves interoperability, but security still depends on a separate enforcement layer that checks tokens, scopes, and policy at runtime.
  • Gateway-based control turns FHIR access into an auditable identity decision, which is essential when PHI, PII, and third-party apps share the same backend.
  • Teams that only secure login flows miss the real risk surface, which is the full request path from token issuance to backend data access.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

NIST Zero Trust (SP 800-207), NIST SP 800-63 and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
NIST Zero Trust (SP 800-207)Gateway token checks and policy enforcement reflect zero trust access decisions.
NIST SP 800-63OIDC-backed authentication and scoped tokens map to digital identity assurance.
NIST CSF 2.0PR.AC-4Access permissions are enforced at runtime through scopes and gateway policy.

Use strong federation and token validation to keep identity assertions current and verifiable.


Key terms

  • SMART on FHIR: A standards-based framework that lets third-party apps request scoped access to electronic health record data. It combines FHIR with OAuth 2.0 and OpenID Connect so authentication, consent, and data access can be governed in a consistent way across healthcare applications.
  • OperationOutcome: A FHIR resource used to return structured error information when an API request fails. It gives clients a standards-compliant explanation of what went wrong, which is especially useful when access is blocked by security policy at the gateway rather than by the backend service.
  • API gateway: A control point that sits in front of backend services and mediates traffic before it reaches the application layer. In identity-heavy architectures, it can validate tokens, enforce policy, rate-limit requests, and create a single audit surface for access decisions.
  • Scoped access token: A token that carries explicit permissions for what an application may do or read, usually within a defined context and time window. In regulated environments, the scope is the key governance signal because it determines whether a valid token is also an appropriate one.

Deepen your knowledge

NHI governance, agentic AI identity, and machine identity lifecycle are core topics in our NHI Foundation Level course, the industry's only accredited NHI security programme. If you are responsible for identity security strategy or NHI governance in your organisation, it is worth exploring.

This post draws on content published by Kong: Level Up Your Digital Health Platform with Kong, SMART on FHIR, Okta. Read the original.

NHIMG Editorial Note
Published by the NHIMG editorial team on 2025-09-02.
NHI Mgmt Group — the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org