rpId — Tenant Identification
What is rpId?
The rpId (Relying Party Identifier) is a domain string that serves two purposes:
- Tenant isolation — The IBEx API uses the rpId to scope users, wallets, and credentials to your application. Each rpId is an isolated namespace.
- WebAuthn security — The browser enforces that the rpId is a registrable domain suffix of the page origin. This prevents cross-domain credential theft.
How to pass your rpId
Every request to the IBEx API must include your registered rpId. Pass it via one of:
| Method | Example | When to use |
|---|---|---|
| Query parameter | ?rpId=yourdomain.com | Server-to-server calls, API testing |
| Header | X-RpId: yourdomain.com | Server-to-server calls, API testing |
| Origin header | (automatic) | Browser requests (fetch/XHR from your app) |
Priority: explicit rpId param > Origin header > Referer header.
If the rpId is missing or not registered, auth endpoints return:
Your rpId must be registered with IBEx before use. Contact your IBEx account manager or contact@ibex.fi.
WebAuthn rpId constraint
The WebAuthn specification requires that the rpId must be a registrable domain suffix of the current page origin:
| Page origin | Valid rpId values | Invalid rpId values |
|---|---|---|
https://app.mycompany.com | mycompany.com, app.mycompany.com | other.com, localhost |
https://wallet.sub.mycompany.com | mycompany.com, sub.mycompany.com | other.com |
http://localhost:3000 | localhost | mycompany.com |
Using your apex domain (e.g., mycompany.com) as rpId is recommended — it works across all your subdomains.
Local development (localhost)
On development environments, localhost, 127.0.0.1, and [::1] are automatically recognized and mapped to a pre-configured localhost domain with a generous daily quota.
This means you can develop and test directly from http://localhost:3000 (or any port) without any DNS configuration:
Browsers treat localhost as a secure context, so WebAuthn works over plain HTTP on localhost — no TLS certificate needed.
Important: Passkeys created with rpId: "localhost" only work on localhost. They will not be available when your app moves to production with a different rpId. This is expected — localhost is for development and testing only.
Production setup
For production, register your domain with IBEx and pass it as the rpId. Two common patterns:
Pattern 1: Direct API calls (recommended for SPAs)
Your frontend calls the IBEx API directly. The browser sends the Origin header automatically.
For this to work, your WebAuthn ceremony must run on a page whose origin is under your registered rpId domain.
Pattern 2: Backend proxy
Your backend proxies requests to the IBEx API. Pass the rpId explicitly:
Common errors
| Error | Cause | Fix |
|---|---|---|
Unknown domain/rpId | rpId not registered in IBEx | Contact IBEx to register your domain |
The RP ID "X" is invalid for this domain | Browser rejects rpId because it's not a suffix of the page origin | Ensure the page serving WebAuthn is under your rpId domain |
rpId: "internal" in WebAuthn options | No rpId was resolved (missing param/header, unregistered domain) | Pass your rpId via query param or header |
Summary
- Register your domain with IBEx as your rpId
- Pass it via
?rpId=,X-RpIdheader, or let the browserOriginheader resolve it - For local development,
localhostworks automatically on development environments - Use your apex domain as rpId for maximum flexibility across subdomains