Path: redb-identity/src/redb.Identity.Web/Components/Pages/Admin/ClaimMapperNew.razor Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Web/Components/Pages/Admin/ClaimMapperNew.razor ---- @page "/admin/claim-mappers/new" @attribute [Authorize] @inject IIdentityClient Client @inject ToastService Toast @inject NavigationManager Nav @* New claim mapper — full-page form (Phase 3, P3: pages-not-dialogs). Replaces the create half of the ClaimMappersList modal, and fixes the modal's blind spot: the OWNER of the rule (global / per-application overlay / claim-scope bundle) was not selectable there at all — every mapper landed global. The page exposes it with the same syntax the API takes. *@
← Go back to Claim mappers

New claim mapper

A rule that emits one claim into issued tokens.

Identity

Source

@if (_form.SourceKind == "Constant") { } else { }

Emission

@if (_error is not null) {

@_error

}
Cancel
@code { private sealed class FormState { public string Name = ""; public string ClaimType = ""; public string SourceKind = "Constant"; public string? SourcePath, ConstantValue, Description; public string Destinations = "access_token, id_token"; public string? RequiredScopes; public int Order; public bool Enabled = true; public bool Required; } private readonly FormState _form = new(); private string _ownerKind = "global"; private long? _ownerId; private bool _saving; private string? _error; private bool IsValid => _form.Name.Trim().Length > 0 && _form.ClaimType.Trim().Length > 0 && (_form.SourceKind == "Constant" ? !string.IsNullOrWhiteSpace(_form.ConstantValue) : !string.IsNullOrWhiteSpace(_form.SourcePath)) && (_ownerKind == "global" || _ownerId is > 0); private string? OwnerString => _ownerKind == "global" ? null : $"{_ownerKind}:{_ownerId}"; private async Task CreateAsync() { _saving = true; _error = null; try { var dest = _form.Destinations.Split(',', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries); var reqScopes = string.IsNullOrWhiteSpace(_form.RequiredScopes) ? null : _form.RequiredScopes.Split(',', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries); var created = await Client.CreateClaimMapperAsync(new CreateClaimMapperRequest { Name = _form.Name.Trim(), ClaimType = _form.ClaimType.Trim(), SourceKind = _form.SourceKind, SourcePath = _form.SourcePath, ConstantValue = _form.ConstantValue, Description = _form.Description, Destinations = dest, RequiredScopes = reqScopes, Order = _form.Order, Enabled = _form.Enabled, Required = _form.Required, Owner = OwnerString, }); Toast.Show($"Mapper '{created.Name}' created.", "online"); Nav.NavigateTo($"/admin/claim-mappers/{Uri.EscapeDataString(created.Id)}"); } catch (Exception ex) { _error = ex.Message; } finally { _saving = false; } } }