You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The extra branding fields customize the hosted login and email experience. `epds_handle_mode` sets your preferred handle mode for new users unless you override it on the authorization URL.
190
193
194
+
## Branding and customization
195
+
196
+
### How branding works
197
+
198
+
ePDS reads branding settings from your app's `client-metadata.json`, using the OAuth `client_id` to look it up. Standard metadata fields like `logo_uri`, `brand_color`, `background_color`, `email_template_uri`, and `email_subject_template` customize the hosted login and email experience.
199
+
200
+
Trusted clients can go further by adding custom CSS in client metadata under `branding.css`:
When the client is trusted, ePDS injects that CSS into its hosted auth pages and the stock consent page.
211
+
212
+
{% callout type="warning" %}
213
+
Trust is checked against the exact `client_id`.
214
+
215
+
The `client_id` you send during OAuth, the `client_id` inside `client-metadata.json`, and the entry in `PDS_OAUTH_TRUSTED_CLIENTS` must all be identical.
216
+
217
+
For example, if your client metadata says `"client_id": "https://hypercerts-scaffold.vercel.app/client-metadata.json"`, then `PDS_OAUTH_TRUSTED_CLIENTS` must contain `https://hypercerts-scaffold.vercel.app/client-metadata.json` — not just `https://hypercerts-scaffold.vercel.app`. See the [Scaffold Starter App](/tools/scaffold) for a concrete example of a client serving metadata from `/client-metadata.json`.
218
+
{% /callout %}
219
+
220
+
### Client metadata branding fields
221
+
222
+
These fields are the main branding controls exposed through client metadata:
223
+
224
+
| Field | What it affects |
225
+
|------|------------------|
226
+
|`logo_uri`| App logo shown in hosted auth and email flows |
227
+
|`brand_color`| Primary brand color used by hosted screens |
228
+
|`background_color`| Background color for hosted screens |
229
+
|`email_template_uri`| Custom HTML template for OTP emails |
230
+
|`email_subject_template`| Subject line template for OTP emails |
231
+
|`branding.css`| Custom CSS for trusted clients |
232
+
233
+
### CSS injection for trusted clients
234
+
235
+
Custom CSS is only applied for clients whose exact `client_id` appears in `PDS_OAUTH_TRUSTED_CLIENTS`. When present, ePDS injects a `<style>` tag into the rendered page, sanitizes the CSS to prevent `</style>` tag closure, and updates the page's CSP `style-src` directive with a SHA-256 hash for the injected stylesheet.
236
+
237
+
This gives operators a safety boundary: untrusted clients never get CSS injection, even if their metadata contains branding CSS.
238
+
239
+
### Where branding appears
240
+
241
+
The send-OTP and initial-OTP screens are two states of the same auth-service route: `https://auth.epds1.test.certified.app/oauth/authorize`.
0 commit comments