My Profile

Identity and device intelligence detail. Sessions and devices are visible in the sidebar on this page and the 3 core session demos (Traditional, BFF, High Trust) — this page has what doesn't fit there.

Architecture & Token Flow
Management API profile editing flow diagram
What this pattern demonstrates

Editing via the Auth0 Management API — the name edit below calls PATCH /api/v2/users/:id using a user-scoped access token— the Traditional session's own access token, requested at login with audience=https://<domain>/api/v2/ and scoped to read:current_user update:current_user_metadata. Not the session's ID token, and not an M2M/admin-scoped Management API credential that could reach every user in the tenant.

A different API, a different trust model — this is deliberately not the same mechanism as /demo/my-account-api's real /me/v1/self-service API. That demo uses Auth0's newer, purpose-built self-service surface, obtaining a fresh token scoped to exactly one operation via a refresh-token exchange made at request time. This page instead reuses a token acquired once, at login, scoped narrowly to the one Management API operation it needs — a path that predates /me/v1/ and that the newer surface is intended to eventually supersede. See /demo/my-account-api for the newer API this contrasts with.

This page is also the suite's session hub — this page, Traditional, BFF, and High Trust are the only 4 pages in this suite where the Session Sidebar appears. That's a deliberate demo choice, not incidental: showing profile editing alongside the sidebar is itself part of what this page demonstrates, not just where it happens to live.

Not signed in

Sign in to any demo to view your unified session profile.

Security Implications

Strengths

  • The token used here is user-scoped to the one update operation, not a blanket M2M/admin Management API credential — a leaked token from this page can edit this one user's record, not reach into the tenant's entire user base.
  • Reuses the same Management API already demonstrated elsewhere in this suite (Traditional's Session Management API calls), so this page adds no new API surface to secure — it's one more narrowly-scoped call against an API the suite already depends on.
  • Simple, well-understood REST semantics — PATCH /api/v2/users/:id is a single, predictable operation with no exotic grant type or token-exchange step behind it.

Risks & Considerations

  • The Management API is a broad, powerful surface not purpose-built for self-service — it covers every administrative operation on the tenant. A token scoped too loosely here (e.g. a broader update:users grant than this one field needs) can reach far more than profile editing.
  • This pattern predates, and will likely be superseded by, the newer /me/v1/ self-service API (see /demo/my-account-api), which has a narrower, purpose-built scope model designed for exactly this kind of end-user self-service — this page is the older of the two approaches, not the recommended one for a new build.
  • This page conflates two things for demo purposes — "profile editing" and "the suite's session hub" (sidebar, Fingerprint device detail) — that happen to live on one route here. That's a deliberate demo-structure choice, not a pattern to replicate in production, where those concerns should stay separated.

Hardening Checklist

  • Scope the Management API token as narrowly as the dashboard allows for this call — a client credential grant limited to update:users is still broader than ideal; prefer the narrowest custom scope the Management API permits for a single-field self-service edit.
  • If building this for real (not as a demo), migrate to the purpose-built /me/v1/ self-service API once its profile endpoint is viable — don't treat the Management API path as the long-term home for end-user self-service.
  • Keep this page's token-minting call server-side only, exactly as this demo does — never let a user-scoped Management API token reach the browser, since unlike the My Account API's narrow scopes, a Management API token is a more consequential credential to leak.