The Simplest Way to Make Json Rpc and SAML Work Like They Should
Pairing json rpc and saml links fast remote calls with central team logins. Users log in once through their identity provider and run remote methods based on role. This setup bridges two different worlds for engineering teams. One protocol moves light JSON messages between apps and backend services. The other protocol uses XML assertions to prove who a user is through a browser. When you link them well, every backend call carries a clear user identity. How json rpc and saml share identity and
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
Pairing json rpc and saml links fast remote calls with central team logins. Users log in once through their identity provider and run remote methods based on role.
This setup bridges two different worlds for engineering teams. One protocol moves light JSON messages between apps and backend services. The other protocol uses XML assertions to prove who a user is through a browser. When you link them well, every backend call carries a clear user identity.
How json rpc and saml share identity and permissions
A user starts by logging in through the central identity provider. The identity provider checks the user and sends back a signed XML assertion. That assertion holds the user email, group names, and role claims.
The client app cannot drop a raw XML block into a light JSON payload. Instead, the login service reads the XML assertion and checks the digital signature. Once checked, the service creates a short session state for that specific user. The client app then puts this session proof into the transport headers or message metadata.
When the client sends a remote method call, the server reads the header first. It maps the user group from the login step to specific method permissions. A read role lets the user run fetch methods only. An admin role lets the user run write or delete methods on the server.
Common failure modes and how to scope roles
Many teams struggle to bridge browser logins with headless remote procedure calls. To save time, engineers often fall back on shared API keys for backend services. Everyone on the team ends up using the same static key for every call.
Shared keys erase user identity from your server logs. When a bad write call breaks production data, you only see the shared service account. You cannot tell which team member ran the destructive method. Even worse, a leaked static key gives an attacker full permissions across all methods.
SAML 2.0 + JSON Web Tokens (JWT): architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Broad tokens cause another major problem in production systems. If a login session lasts for weeks, a stolen token stays valid for too long. If every logged-in user gets full method permissions, one mistake can wipe out key data.
To fix this, teams must scope roles down to the exact method name. Map each identity provider group to a strict list of allowed remote calls. Set login assertions and session states to expire after a short work window. Check the user role on every single call, not just when the session starts.
Logging and masking data across remote calls
Good security requires a clear record of every remote call in production. Your logs should link the SAML user email to the exact method name and time. When auditors check your systems, they need to see who ran what and when.
Remote calls also return sensitive data inside the JSON response body. A method might return customer emails, phone numbers, card numbers, or national IDs. Logging or returning raw payloads puts that private data at risk. Data masking rules can rewrite matched fields in results before the payload reaches the client. This keeps sensitive records safe while engineers debug production issues.
Govern statements and responses across databases and APIs
Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev runs beside each supported service as an open-source proxy, a sidecar for your database or API.
First, hoop.dev guardrails block banned queries before they run. Then hoop.dev data masking rewrites matched sensitive values in responses in memory. The audit trail records every statement and verdict per resource. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.
Frequently asked questions
Can a JSON-RPC payload carry a SAML assertion directly?
It is possible, but putting large XML blocks inside JSON payloads is slow and messy. Most teams trade the checked XML assertion for a compact session header first.
How do CLI tools handle browser-based SAML logins for remote calls?
A CLI tool opens a local browser window so the user can log in. After the identity provider checks the user, the CLI catches the session state for future calls.
How should we map SAML groups to JSON-RPC methods?
Create clear role groups in your identity provider for read, write, and admin tasks. Configure your server to check the group claim before it runs the requested method name.
Related guides
In this post