auth

Main authentication module for my projects
git clone git://git.finwo.net/app/auth
Log | Files | Refs

admin-realm-provider-edit.html (43578B)


      1 <!doctype html>
      2 <html lang="en">
      3   <head>
      4     <meta charset="utf-8" />
      5     <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
      6     <title>Admin realm provider edit mockup</title>
      7     <link rel="stylesheet" href="../../app/shared/style/global.css" />
      8     <link rel="stylesheet" href="../../app/shared/component/select-menu.css" />
      9     <link rel="stylesheet" href="../../app/shared/component/user-menu.css" />
     10     <link rel="stylesheet" href="./mockups.css" />
     11   </head>
     12   <body>
     13     <header class="topbar">
     14       <a class="brand" href="./admin-dashboard.html">
     15         <svg class="brand-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
     16           <path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z" />
     17         </svg>
     18         <span class="brand-name">Auth</span>
     19       </a>
     20       <div class="topbar-actions">
     21         <button class="mobile-nav-toggle" type="button" id="mobile-nav-toggle" aria-controls="mobile-navigation" aria-expanded="false" aria-label="Open navigation">
     22           <span class="mobile-nav-toggle-bars" aria-hidden="true"></span>
     23         </button>
     24         <details class="menu user-menu">
     25           <summary class="menu-trigger" aria-label="Account menu">
     26             <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
     27               <circle cx="12" cy="12" r="10" />
     28               <circle cx="12" cy="10" r="3" />
     29               <path d="M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662" />
     30             </svg>
     31           </summary>
     32           <div class="menu-panel">
     33             <div class="menu-heading">
     34               <span class="menu-heading-title">System Admin</span>
     35               <span class="menu-heading-meta">admin@system.test</span>
     36             </div>
     37             <div class="menu-list">
     38               <a class="menu-item" href="#">
     39                 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
     40                   <path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1-1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" />
     41                   <circle cx="12" cy="12" r="3" />
     42                 </svg>
     43                 <span>Account settings</span>
     44               </a>
     45               <button class="menu-item" type="button" data-user-theme>
     46                 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
     47                   <circle cx="12" cy="12" r="4" />
     48                   <path d="M12 2v2" />
     49                   <path d="M12 20v2" />
     50                   <path d="m4.93 4.93 1.41 1.41" />
     51                   <path d="m17.66 17.66 1.41 1.41" />
     52                   <path d="M2 12h2" />
     53                   <path d="M20 12h2" />
     54                   <path d="m6.34 17.66-1.41 1.41" />
     55                   <path d="m19.07 4.93-1.41 1.41" />
     56                 </svg>
     57                 <span>Theme</span>
     58                 <span class="menu-value" data-user-theme-value>Auto</span>
     59               </button>
     60               <a class="menu-item" href="#">
     61                 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
     62                   <path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" />
     63                   <path d="m16 17 5-5-5-5" />
     64                   <path d="M21 12H9" />
     65                 </svg>
     66                 <span>Sign out</span>
     67               </a>
     68             </div>
     69           </div>
     70         </details>
     71       </div>
     72     </header>
     73 
     74     <div class="mobile-nav" id="mobile-navigation" aria-hidden="true">
     75       <nav class="nav" aria-label="Administration">
     76         <p class="nav-label">Administration</p>
     77         <a class="nav-item" href="./admin-dashboard.html">
     78           <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
     79             <rect x="3" y="3" width="7" height="7" />
     80             <rect x="14" y="3" width="7" height="7" />
     81             <rect x="3" y="14" width="7" height="7" />
     82             <rect x="14" y="14" width="7" height="7" />
     83           </svg>
     84           <span>Overview</span>
     85         </a>
     86         <a class="nav-item is-active" data-realm-nav href="./admin-realms.html">
     87           <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
     88             <path d="M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z" />
     89             <path d="M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2" />
     90             <path d="M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2" />
     91             <path d="M10 6h4" />
     92             <path d="M10 10h4" />
     93             <path d="M10 14h4" />
     94             <path d="M10 18h4" />
     95           </svg>
     96           <span data-realm-nav-label>Realms</span>
     97         </a>
     98         <a class="nav-item" href="./admin-clients.html">
     99           <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
    100             <rect x="2" y="4" width="20" height="16" rx="2" />
    101             <path d="M10 4v4" />
    102             <path d="M2 8h20" />
    103             <path d="M6 4v4" />
    104           </svg>
    105           <span>Clients</span>
    106         </a>
    107         <a class="nav-item" href="#">
    108           <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
    109             <path d="M22 12h-4l-3 8-6-16-3 8H2" />
    110           </svg>
    111           <span>Sessions</span>
    112         </a>
    113         <a class="nav-item" href="./admin-users.html">
    114           <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
    115             <path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" />
    116             <circle cx="12" cy="7" r="4" />
    117           </svg>
    118           <span>Users</span>
    119         </a>
    120         <a class="nav-item" data-settings-nav href="./admin-system-settings.html">
    121           <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
    122             <path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1-1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" />
    123             <circle cx="12" cy="12" r="3" />
    124           </svg>
    125           <span>Settings</span>
    126         </a>
    127       </nav>
    128       <div class="mobile-nav-divider" aria-hidden="true"></div>
    129       <section class="mobile-nav-account" aria-label="Account">
    130         <div class="menu-heading">
    131           <span class="menu-heading-title">System Admin</span>
    132           <span class="menu-heading-meta">admin@system.test</span>
    133         </div>
    134         <div class="menu-list">
    135           <a class="menu-item" href="#">
    136             <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
    137               <path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1-1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" />
    138               <circle cx="12" cy="12" r="3" />
    139             </svg>
    140             <span>Account settings</span>
    141           </a>
    142           <button class="menu-item" type="button" data-user-theme>
    143             <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
    144               <circle cx="12" cy="12" r="4" />
    145               <path d="M12 2v2" />
    146               <path d="M12 20v2" />
    147               <path d="m4.93 4.93 1.41 1.41" />
    148               <path d="m17.66 17.66 1.41 1.41" />
    149               <path d="M2 12h2" />
    150               <path d="M20 12h2" />
    151               <path d="m6.34 17.66-1.41 1.41" />
    152               <path d="m19.07 4.93-1.41 1.41" />
    153             </svg>
    154             <span>Theme</span>
    155             <span class="menu-value" data-user-theme-value>Auto</span>
    156           </button>
    157           <a class="menu-item" href="#">
    158             <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
    159               <path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" />
    160               <path d="m16 17 5-5-5-5" />
    161               <path d="M21 12H9" />
    162             </svg>
    163             <span>Sign out</span>
    164           </a>
    165         </div>
    166       </section>
    167     </div>
    168 
    169     <div class="app">
    170       <aside class="sidebar">
    171         <nav class="nav" aria-label="Administration">
    172           <p class="nav-label">Administration</p>
    173           <a class="nav-item" href="./admin-dashboard.html">
    174             <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
    175               <rect x="3" y="3" width="7" height="7" />
    176               <rect x="14" y="3" width="7" height="7" />
    177               <rect x="3" y="14" width="7" height="7" />
    178               <rect x="14" y="14" width="7" height="7" />
    179             </svg>
    180             <span>Overview</span>
    181           </a>
    182           <a class="nav-item is-active" data-realm-nav href="./admin-realms.html">
    183             <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
    184               <path d="M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z" />
    185               <path d="M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2" />
    186               <path d="M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2" />
    187               <path d="M10 6h4" />
    188               <path d="M10 10h4" />
    189               <path d="M10 14h4" />
    190               <path d="M10 18h4" />
    191             </svg>
    192             <span data-realm-nav-label>Realms</span>
    193           </a>
    194           <a class="nav-item" href="./admin-clients.html">
    195             <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
    196               <rect x="2" y="4" width="20" height="16" rx="2" />
    197               <path d="M10 4v4" />
    198               <path d="M2 8h20" />
    199               <path d="M6 4v4" />
    200             </svg>
    201             <span>Clients</span>
    202           </a>
    203           <a class="nav-item" href="#">
    204             <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
    205               <path d="M22 12h-4l-3 8-6-16-3 8H2" />
    206             </svg>
    207             <span>Sessions</span>
    208           </a>
    209           <a class="nav-item" href="./admin-users.html">
    210             <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
    211               <path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" />
    212               <circle cx="12" cy="7" r="4" />
    213             </svg>
    214             <span>Users</span>
    215           </a>
    216           <a class="nav-item" data-settings-nav href="./admin-system-settings.html">
    217             <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
    218               <path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1-1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" />
    219               <circle cx="12" cy="12" r="3" />
    220             </svg>
    221             <span>Settings</span>
    222           </a>
    223         </nav>
    224       </aside>
    225 
    226       <div class="main">
    227         <main class="content">
    228           <div class="page-header">
    229             <div class="breadcrumb">
    230               <a id="provider-breadcrumb-root" href="./admin-realms.html"><span data-realm-breadcrumb-root>Realms</span></a>
    231               <span>/</span>
    232               <a id="provider-breadcrumb-realm" href="./admin-settings.html?realm=acme">Acme</a>
    233               <span>/</span>
    234               <a id="provider-breadcrumb-providers" href="./admin-realm-providers.html?realm=acme">Identity providers</a>
    235               <span>/</span>
    236               <span aria-current="page" id="provider-breadcrumb-current">Add provider</span>
    237             </div>
    238             <h1 id="provider-page-title">Add provider</h1>
    239             <p id="provider-page-subtitle">Register an external sign-in provider for this realm.</p>
    240           </div>
    241 
    242           <div id="provider-notice" class="notice" role="status" hidden></div>
    243 
    244           <div class="stack">
    245             <form id="provider-form" class="stack" novalidate>
    246               <section class="panel" aria-labelledby="provider-identity-title">
    247                 <h2 id="provider-identity-title">Provider</h2>
    248                 <div id="provider-alert" class="alert" role="alert" hidden></div>
    249 
    250                 <label class="field" for="provider-slug-input">
    251                   <span class="field-label">Slug</span>
    252                   <input id="provider-slug-input" class="field-control u-mono" type="text" maxlength="64" placeholder="example-sso" autocomplete="off" spellcheck="false" />
    253                   <span class="field-hint" id="provider-slug-help">Lowercase letters, numbers and hyphens. Used in provider URLs and audit logs.</span>
    254                 </label>
    255 
    256                 <label class="field" for="provider-name-input">
    257                   <span class="field-label">Display name</span>
    258                   <input id="provider-name-input" class="field-control" type="text" maxlength="120" placeholder="Example SSO" autocomplete="off" />
    259                   <span class="field-hint">Shown to users when this provider is offered at sign-in.</span>
    260                 </label>
    261 
    262                 <label class="field" for="provider-issuer-input">
    263                   <span class="field-label">Issuer</span>
    264                   <input id="provider-issuer-input" class="field-control u-mono" type="text" maxlength="253" placeholder="https://idp.example.com" autocomplete="off" spellcheck="false" />
    265                   <span class="field-hint">The OIDC issuer URL. Must be https and must not end with a slash.</span>
    266                 </label>
    267 
    268                 <label class="field" for="provider-client-id-input">
    269                   <span class="field-label">Client id</span>
    270                   <input id="provider-client-id-input" class="field-control u-mono" type="text" maxlength="255" placeholder="auth-example" autocomplete="off" spellcheck="false" />
    271                 </label>
    272 
    273                 <div class="field">
    274                   <span class="field-label" id="provider-secret-label">Client secret</span>
    275                   <input id="provider-secret-input" class="field-control u-mono" type="password" maxlength="255" autocomplete="new-password" spellcheck="false" aria-labelledby="provider-secret-label" />
    276                   <span class="field-hint" id="provider-secret-help">Leave blank for public or native apps that do not use a secret.</span>
    277                   <div class="u-cluster">
    278                     <button id="provider-secret-remove" class="button button-secondary" type="button" hidden>Remove secret</button>
    279                   </div>
    280                 </div>
    281 
    282                 <label class="field" for="provider-scopes-input">
    283                   <span class="field-label">Scopes</span>
    284                   <input id="provider-scopes-input" class="field-control u-mono" type="text" maxlength="255" value="openid email profile" autocomplete="off" spellcheck="false" />
    285                   <span class="field-hint">Space-separated OIDC scopes requested from the provider.</span>
    286                 </label>
    287 
    288                 <div class="action-row">
    289                   <a id="provider-cancel-link" class="button button-secondary" href="./admin-realm-providers.html?realm=acme">Cancel</a>
    290                   <button id="provider-save-button" class="button button-primary" type="submit">Create provider</button>
    291                 </div>
    292               </section>
    293 
    294               <section class="panel" aria-labelledby="provider-status-title">
    295                 <h2 id="provider-status-title">Status</h2>
    296                 <label class="checkbox">
    297                   <input id="provider-enabled-input" type="checkbox" checked />
    298                   <span>Enabled</span>
    299                 </label>
    300                 <p class="note">Disabled providers stay configured but new sign-ins use password instead.</p>
    301                 <p id="provider-fallback-note" class="note" hidden></p>
    302               </section>
    303             </form>
    304 
    305             <section class="panel" id="provider-domains-panel" aria-labelledby="provider-domains-title">
    306               <h2 id="provider-domains-title">Connected domains</h2>
    307               <p class="note">Verified email domains that route sign-in through this provider.</p>
    308 
    309               <div class="toolbar toolbar-panel">
    310                 <div class="field">
    311                   <span class="field-label" id="provider-domain-select-label">Email domain</span>
    312                   <div class="select" id="provider-domain-select" data-select data-value="">
    313                     <button
    314                       class="select-trigger"
    315                       type="button"
    316                       id="provider-domain-trigger"
    317                       role="combobox"
    318                       aria-haspopup="listbox"
    319                       aria-expanded="false"
    320                       aria-controls="provider-domain-listbox"
    321                       aria-labelledby="provider-domain-select-label"
    322                     >
    323                       <span class="select-value">Select a domain</span>
    324                       <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
    325                         <path d="m6 9 6 6 6-6" />
    326                       </svg>
    327                     </button>
    328                     <div class="select-list" id="provider-domain-listbox" role="listbox" aria-labelledby="provider-domain-select-label" hidden>
    329                       <div class="select-option is-selected" role="option" aria-selected="true" data-value="" data-label="Select a domain">
    330                         <span class="select-option-mark" aria-hidden="true"></span>
    331                         <span class="select-option-label">Select a domain</span>
    332                       </div>
    333                       <div class="select-option" role="option" aria-selected="false" data-value="acme.test" data-domain-realm="acme" data-label="acme.test">
    334                         <span class="select-option-mark" aria-hidden="true">
    335                           <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
    336                             <path d="M20 6 9 17l-5-5" />
    337                           </svg>
    338                         </span>
    339                         <span class="select-option-label">acme.test</span>
    340                       </div>
    341                       <div class="select-option" role="option" aria-selected="false" data-value="sso.acme.test" data-domain-realm="acme" data-label="sso.acme.test">
    342                         <span class="select-option-mark" aria-hidden="true">
    343                           <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
    344                             <path d="M20 6 9 17l-5-5" />
    345                           </svg>
    346                         </span>
    347                         <span class="select-option-label">sso.acme.test</span>
    348                       </div>
    349                       <div class="select-option" role="option" aria-selected="false" data-value="employees.acme.test" data-domain-realm="acme" data-label="employees.acme.test">
    350                         <span class="select-option-mark" aria-hidden="true">
    351                           <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
    352                             <path d="M20 6 9 17l-5-5" />
    353                           </svg>
    354                         </span>
    355                         <span class="select-option-label">employees.acme.test</span>
    356                       </div>
    357                       <div class="select-option" role="option" aria-selected="false" data-value="globex.test" data-domain-realm="globex" data-label="globex.test">
    358                         <span class="select-option-mark" aria-hidden="true">
    359                           <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
    360                             <path d="M20 6 9 17l-5-5" />
    361                           </svg>
    362                         </span>
    363                         <span class="select-option-label">globex.test</span>
    364                       </div>
    365                     </div>
    366                   </div>
    367                 </div>
    368                 <div class="toolbar-actions">
    369                   <button id="provider-domain-connect" class="button button-primary" type="button">Connect</button>
    370                 </div>
    371               </div>
    372 
    373               <table class="table">
    374                 <thead>
    375                   <tr>
    376                     <th scope="col">Domain</th>
    377                     <th scope="col">Added</th>
    378                     <th scope="col">Actions</th>
    379                   </tr>
    380                 </thead>
    381                 <tbody id="provider-domain-rows"></tbody>
    382               </table>
    383               <p id="provider-domains-empty" class="empty" hidden>No email domains are connected to this provider.</p>
    384             </section>
    385 
    386             <section class="panel" id="provider-domains-create-note">
    387               <h2>Connected domains</h2>
    388               <p class="note">Save the provider first to connect verified email domains to it.</p>
    389             </section>
    390 
    391             <section class="state-preview">
    392               <h2>Loading state</h2>
    393               <div class="panel" aria-busy="true">
    394                 <div class="skeleton skeleton-title"></div>
    395                 <div class="skeleton"></div>
    396                 <div class="skeleton skeleton-short"></div>
    397               </div>
    398             </section>
    399           </div>
    400         </main>
    401       </div>
    402     </div>
    403 
    404     <div class="mockup-controls" aria-label="Mockup controls">
    405       <span class="mockup-label">Mockup</span>
    406       <button class="mockup-button is-active" type="button" data-theme-target="auto">Auto</button>
    407       <button class="mockup-button" type="button" data-theme-target="light">Light</button>
    408       <button class="mockup-button" type="button" data-theme-target="dark">Dark</button>
    409       <span class="mockup-separator" aria-hidden="true"></span>
    410       <span class="mockup-label">View as</span>
    411       <button class="mockup-button is-active" type="button" data-role-target="system" aria-pressed="true">System admin</button>
    412       <button class="mockup-button" type="button" data-role-target="owner" aria-pressed="false">Realm owner</button>
    413       <button class="mockup-button" type="button" data-role-target="admin" aria-pressed="false">Realm admin</button>
    414     </div>
    415 
    416     <script>
    417       const root = document.documentElement;
    418       const themeButtons = document.querySelectorAll('[data-theme-target]');
    419       const userThemeButtons = document.querySelectorAll('[data-user-theme]');
    420       const userThemeValues = document.querySelectorAll('[data-user-theme-value]');
    421       let currentTheme = 'auto';
    422 
    423       function setTheme(value) {
    424         currentTheme = value;
    425         if (value === 'auto') {
    426           root.removeAttribute('data-theme');
    427         } else {
    428           root.setAttribute('data-theme', value);
    429         }
    430 
    431         themeButtons.forEach((button) => {
    432           button.classList.toggle('is-active', button.dataset.themeTarget === value);
    433         });
    434         userThemeValues.forEach((element) => {
    435           element.textContent = value.charAt(0).toUpperCase() + value.slice(1);
    436         });
    437 
    438         if (typeof syncUrl === 'function') syncUrl();
    439       }
    440 
    441       themeButtons.forEach((button) => {
    442         button.addEventListener('click', () => setTheme(button.dataset.themeTarget));
    443       });
    444 
    445       userThemeButtons.forEach((button) => {
    446         button.addEventListener('click', () => {
    447           const themes = ['auto', 'light', 'dark'];
    448           setTheme(themes[(themes.indexOf(currentTheme) + 1) % themes.length]);
    449         });
    450       });
    451 
    452       const userMenu = document.querySelector('.user-menu');
    453       document.addEventListener('click', (event) => {
    454         if (userMenu && userMenu.open && !userMenu.contains(event.target)) {
    455           userMenu.open = false;
    456         }
    457       });
    458 
    459       const identities = {
    460         system: { name: 'System Admin', email: 'admin@system.test' },
    461         owner: { name: 'Realm Owner', email: 'owner@acme.test' },
    462         admin: { name: 'Realm Admin', email: 'realm-admin@managed.test' },
    463       };
    464 
    465       const realmInfo = {
    466         acme: { label: 'Acme', roles: ['system', 'owner'] },
    467         globex: { label: 'Globex', roles: ['system', 'admin'] },
    468         northwind: { label: 'Northwind', roles: ['system'] },
    469       };
    470 
    471       const realmEmailDomains = {
    472         acme: ['acme.test', 'sso.acme.test'],
    473         globex: ['globex.test'],
    474         northwind: [],
    475       };
    476 
    477       const providers = {
    478         acme: [
    479           {
    480             slug: 'example-sso',
    481             name: 'Example SSO',
    482             issuer: 'https://idp.example.com',
    483             clientId: 'auth-example',
    484             hasSecret: true,
    485             enabled: true,
    486             domains: ['sso.acme.test'],
    487           },
    488           {
    489             slug: 'legacy-sso',
    490             name: 'Legacy SSO',
    491             issuer: 'https://old-idp.example.net',
    492             clientId: 'legacy-app',
    493             hasSecret: false,
    494             enabled: false,
    495             domains: [],
    496           },
    497         ],
    498         globex: [
    499           {
    500             slug: 'globex-id',
    501             name: 'Globex Identity',
    502             issuer: 'https://login.globex.test',
    503             clientId: 'gx-auth',
    504             hasSecret: true,
    505             enabled: true,
    506             domains: ['globex.test'],
    507           },
    508         ],
    509         northwind: [],
    510       };
    511 
    512       const initialParams = new URLSearchParams(window.location.search);
    513       let currentThemeInit = initialParams.get('theme');
    514       if (currentThemeInit === 'light' || currentThemeInit === 'dark') setTheme(currentThemeInit);
    515 
    516       let currentRole = initialParams.get('role');
    517       if (!identities[currentRole]) currentRole = 'system';
    518 
    519       let currentRealm = initialParams.get('realm');
    520       if (!realmInfo[currentRealm] || !realmInfo[currentRealm].roles.includes(currentRole)) {
    521         currentRealm = 'acme';
    522       }
    523 
    524       const providerSlug = initialParams.get('provider');
    525       const provider = providerSlug ? (providers[currentRealm] || []).find((entry) => entry.slug === providerSlug) : null;
    526       const isEdit = Boolean(provider);
    527 
    528       const notice = document.getElementById('provider-notice');
    529       const alert = document.getElementById('provider-alert');
    530       const slugInput = document.getElementById('provider-slug-input');
    531       const slugHelp = document.getElementById('provider-slug-help');
    532       const nameInput = document.getElementById('provider-name-input');
    533       const issuerInput = document.getElementById('provider-issuer-input');
    534       const clientIdInput = document.getElementById('provider-client-id-input');
    535       const secretInput = document.getElementById('provider-secret-input');
    536       const secretHelp = document.getElementById('provider-secret-help');
    537       const secretRemove = document.getElementById('provider-secret-remove');
    538       const scopesInput = document.getElementById('provider-scopes-input');
    539       const enabledInput = document.getElementById('provider-enabled-input');
    540       const fallbackNote = document.getElementById('provider-fallback-note');
    541       const saveButton = document.getElementById('provider-save-button');
    542       const form = document.getElementById('provider-form');
    543 
    544       const domainPanel = document.getElementById('provider-domains-panel');
    545       const domainCreateNote = document.getElementById('provider-domains-create-note');
    546       const domainRows = document.getElementById('provider-domain-rows');
    547       const domainsEmpty = document.getElementById('provider-domains-empty');
    548       const domainSelect = document.getElementById('provider-domain-select');
    549       const domainSelectValue = domainSelect.querySelector('.select-value');
    550       const domainOptions = [...domainSelect.querySelectorAll('.select-option')];
    551       const connectButton = document.getElementById('provider-domain-connect');
    552 
    553       const breadcrumbRootLink = document.getElementById('provider-breadcrumb-root');
    554       const breadcrumbRealmLink = document.getElementById('provider-breadcrumb-realm');
    555       const breadcrumbProvidersLink = document.getElementById('provider-breadcrumb-providers');
    556       const breadcrumbCurrent = document.getElementById('provider-breadcrumb-current');
    557       const cancelLink = document.getElementById('provider-cancel-link');
    558       const realmNavLinks = document.querySelectorAll('[data-realm-nav]');
    559       const realmNavLabels = document.querySelectorAll('[data-realm-nav-label]');
    560       const settingsNavLinks = document.querySelectorAll('[data-settings-nav]');
    561       const breadcrumbRootLabels = document.querySelectorAll('[data-realm-breadcrumb-root]');
    562 
    563       const secretPlaceholderUnset = 'No secret configured. Enter one to make this a confidential client.';
    564       const secretPlaceholderSet = 'Configured. Leave blank to keep the current secret.';
    565       const secretPlaceholderRemoved = 'The stored secret will be removed on save.';
    566       const secretCreatePlaceholder = 'Optional. Leave blank for public or native apps.';
    567       let secretCleared = false;
    568 
    569       function listUrl(extraParams) {
    570         const params = new URLSearchParams();
    571         params.set('realm', currentRealm);
    572         params.set('role', currentRole);
    573         if (currentTheme !== 'auto') params.set('theme', currentTheme);
    574         if (extraParams) {
    575           new URLSearchParams(extraParams).forEach((value, key) => params.set(key, value));
    576         }
    577         return `./admin-realm-providers.html?${params.toString()}`;
    578       }
    579 
    580       function showNotice(message) {
    581         notice.textContent = message;
    582         notice.hidden = false;
    583       }
    584 
    585       function showAlert(message) {
    586         alert.textContent = message;
    587         alert.hidden = false;
    588       }
    589 
    590       function clearAlert() {
    591         alert.hidden = true;
    592         alert.textContent = '';
    593       }
    594 
    595       function escapeHtml(value) {
    596         return String(value).replace(/[&<>"']/g, (character) => {
    597           const entities = { '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' };
    598           return entities[character];
    599         });
    600       }
    601 
    602       function slugify(value) {
    603         return value
    604           .toLowerCase()
    605           .replace(/[^a-z0-9-]+/g, '-')
    606           .replace(/^-+|-+$/g, '')
    607           .slice(0, 64);
    608       }
    609 
    610       function setRole(role) {
    611         currentRole = role;
    612         const identity = identities[role];
    613 
    614         document.querySelectorAll('.menu-heading-title').forEach((element) => {
    615           element.textContent = identity.name;
    616         });
    617         document.querySelectorAll('.menu-heading-meta').forEach((element) => {
    618           element.textContent = identity.email;
    619         });
    620 
    621         document.querySelectorAll('[data-role-target]').forEach((button) => {
    622           const active = button.dataset.roleTarget === role;
    623           button.classList.toggle('is-active', active);
    624           button.setAttribute('aria-pressed', String(active));
    625         });
    626 
    627         settingsNavLinks.forEach((link) => {
    628           link.hidden = role !== 'system';
    629         });
    630 
    631         const accessibleCount = Object.keys(realmInfo).filter((slug) => realmInfo[slug].roles.includes(role)).length;
    632         const label = accessibleCount === 1 ? 'Realm' : 'Realms';
    633         realmNavLabels.forEach((element) => {
    634           element.textContent = label;
    635         });
    636         breadcrumbRootLabels.forEach((element) => {
    637           element.textContent = label;
    638         });
    639         const realmHref = accessibleCount === 1 ? `./admin-settings.html?realm=${currentRealm}` : './admin-realms.html';
    640         realmNavLinks.forEach((link) => {
    641           link.href = realmHref;
    642           link.classList.add('is-active');
    643         });
    644         breadcrumbRootLink.href = realmHref;
    645 
    646         syncUrl();
    647       }
    648 
    649       function syncUrl() {
    650         const params = new URLSearchParams();
    651         params.set('realm', currentRealm);
    652         params.set('role', currentRole);
    653         if (currentTheme !== 'auto') params.set('theme', currentTheme);
    654         if (isEdit) params.set('provider', provider.slug);
    655         try {
    656           window.history.replaceState({}, '', `${window.location.pathname}?${params.toString()}`);
    657         } catch (e) {
    658           /* ignore history updates when opened from file:// */
    659         }
    660       }
    661 
    662       document.querySelectorAll('[data-role-target]').forEach((button) => {
    663         button.addEventListener('click', () => setRole(button.dataset.roleTarget));
    664       });
    665 
    666       function applyChrome() {
    667         document.title = isEdit ? `Edit ${provider.name} mockup` : 'Add provider mockup';
    668         document.getElementById('provider-page-title').textContent = isEdit ? `Edit ${provider.name}` : 'Add provider';
    669         document.getElementById('provider-page-subtitle').textContent = isEdit
    670           ? 'Update provider configuration and the email domains routed to it.'
    671           : 'Register an external sign-in provider for this realm.';
    672         breadcrumbCurrent.textContent = isEdit ? provider.name : 'Add provider';
    673         breadcrumbRealmLink.textContent = realmInfo[currentRealm].label;
    674         breadcrumbRealmLink.href = `./admin-settings.html?realm=${encodeURIComponent(currentRealm)}`;
    675         breadcrumbProvidersLink.href = listUrl();
    676         cancelLink.href = listUrl();
    677         saveButton.textContent = isEdit ? 'Save changes' : 'Create provider';
    678         domainPanel.hidden = !isEdit;
    679         domainCreateNote.hidden = isEdit;
    680 
    681         if (isEdit) {
    682           slugInput.value = provider.slug;
    683           slugInput.readOnly = true;
    684           slugHelp.textContent = 'The slug cannot be changed after the provider is created.';
    685           nameInput.value = provider.name;
    686           issuerInput.value = provider.issuer;
    687           clientIdInput.value = provider.clientId;
    688           scopesInput.value = provider.scopes || 'openid email profile';
    689           enabledInput.checked = provider.enabled;
    690           secretInput.placeholder = secretPlaceholderSet;
    691           secretRemove.hidden = !provider.hasSecret;
    692           if (!provider.hasSecret) {
    693             secretInput.placeholder = secretPlaceholderUnset;
    694             secretHelp.textContent = 'This provider has no secret. Entering one switches it to confidential authentication.';
    695           } else {
    696             secretHelp.textContent = 'The current secret is never displayed. Enter a new value to replace it.';
    697           }
    698         } else {
    699           secretInput.placeholder = secretCreatePlaceholder;
    700         }
    701 
    702         updateFallbackNote();
    703         renderDomains();
    704       }
    705 
    706       function connectedDomains() {
    707         return isEdit ? provider.domains : [];
    708       }
    709 
    710       function mappedByOther(domain) {
    711         return (providers[currentRealm] || []).some(
    712           (entry) => entry.slug !== (isEdit ? provider.slug : '') && entry.domains.includes(domain)
    713         );
    714       }
    715 
    716       function availableDomains() {
    717         return realmEmailDomains[currentRealm].filter((domain) => !mappedByOther(domain));
    718       }
    719 
    720       function renderDomains() {
    721         if (!isEdit) return;
    722         const rows = connectedDomains().map((domain) => {
    723           const row = document.createElement('tr');
    724           row.innerHTML =
    725             '<td data-label="Domain"><span class="table-mono">' +
    726             escapeHtml(domain) +
    727             '</span></td>' +
    728             '<td data-label="Added"><span class="table-meta">12 Mar 2026</span></td>' +
    729             '<td data-label="Actions"><button class="button-inline button-danger" type="button" data-disconnect-domain="' +
    730             escapeHtml(domain) +
    731             '">Disconnect</button></td>';
    732           return row;
    733         });
    734         domainRows.replaceChildren(...rows);
    735         domainsEmpty.hidden = rows.length !== 0;
    736       }
    737 
    738       function syncDomainOptions() {
    739         const available = isEdit ? availableDomains() : [];
    740         domainOptions.forEach((option) => {
    741           if (!option.dataset.value) return;
    742           option.hidden = !available.includes(option.dataset.value);
    743         });
    744         const selected = domainSelect.dataset.value;
    745         if (selected && !available.includes(selected)) resetDomainSelect();
    746         connectButton.disabled = !available.length;
    747       }
    748 
    749       function resetDomainSelect() {
    750         domainSelect.dataset.value = '';
    751         domainSelectValue.textContent = 'Select a domain';
    752         domainOptions.forEach((option, index) => {
    753           const selected = index === 0;
    754           option.classList.toggle('is-selected', selected);
    755           option.setAttribute('aria-selected', String(selected));
    756         });
    757       }
    758 
    759       function updateFallbackNote() {
    760         if (enabledInput.checked || !isEdit || !provider.domains.length) {
    761           fallbackNote.hidden = true;
    762           return;
    763         }
    764         fallbackNote.textContent = `While this provider is disabled, sign-in for ${provider.domains.join(', ')} falls back to password.`;
    765         fallbackNote.hidden = false;
    766       }
    767 
    768       enabledInput.addEventListener('change', updateFallbackNote);
    769 
    770       let slugTouched = false;
    771       slugInput.addEventListener('input', () => {
    772         slugTouched = true;
    773         clearAlert();
    774       });
    775       [nameInput, issuerInput, clientIdInput, scopesInput].forEach((input) => {
    776         input.addEventListener('input', clearAlert);
    777       });
    778       nameInput.addEventListener('input', () => {
    779         if (!isEdit && !slugTouched) slugInput.value = slugify(nameInput.value);
    780       });
    781 
    782       secretInput.addEventListener('input', () => {
    783         if (!isEdit || !secretInput.value) return;
    784         if (secretCleared) {
    785           secretCleared = false;
    786           secretInput.placeholder = secretPlaceholderSet;
    787           secretRemove.hidden = !provider.hasSecret;
    788         }
    789         secretHelp.textContent = 'The current secret is never displayed. Enter a new value to replace it.';
    790       });
    791 
    792       secretRemove.addEventListener('click', () => {
    793         secretCleared = true;
    794         secretInput.value = '';
    795         secretInput.placeholder = secretPlaceholderRemoved;
    796         secretRemove.hidden = true;
    797         secretHelp.textContent = 'This provider will stop using a client secret after saving.';
    798       });
    799 
    800       connectButton.addEventListener('click', () => {
    801         const domain = domainSelect.dataset.value;
    802         if (!domain || !isEdit) return;
    803         provider.domains.push(domain);
    804         resetDomainSelect();
    805         renderDomains();
    806         syncDomainOptions();
    807         updateFallbackNote();
    808         showNotice(`Email domain ${domain} connected to ${provider.name}.`);
    809       });
    810 
    811       domainRows.addEventListener('click', (event) => {
    812         const button = event.target.closest('[data-disconnect-domain]');
    813         if (!button || !isEdit) return;
    814         const domain = button.dataset.disconnectDomain;
    815         provider.domains = provider.domains.filter((entry) => entry !== domain);
    816         renderDomains();
    817         syncDomainOptions();
    818         updateFallbackNote();
    819         showNotice(`Email domain ${domain} disconnected from ${provider.name}.`);
    820       });
    821 
    822       form.addEventListener('submit', (event) => {
    823         event.preventDefault();
    824         clearAlert();
    825 
    826         const slug = slugInput.value.trim().toLowerCase();
    827         const name = nameInput.value.trim();
    828         const issuer = issuerInput.value.trim();
    829         const clientId = clientIdInput.value.trim();
    830 
    831         if (!name) {
    832           showAlert('Display name is required.');
    833           nameInput.focus();
    834           return;
    835         }
    836         if (!slug || !/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/.test(slug)) {
    837           showAlert('Slug must use lowercase letters, numbers and hyphens.');
    838           slugInput.focus();
    839           return;
    840         }
    841         if (
    842           !isEdit &&
    843           (providers[currentRealm] || []).some((entry) => entry.slug === slug)
    844         ) {
    845           showAlert('A provider with this slug already exists in the realm.');
    846           slugInput.focus();
    847           return;
    848         }
    849         if (!issuer.startsWith('https://')) {
    850           showAlert('Issuer must start with https://.');
    851           issuerInput.focus();
    852           return;
    853         }
    854         if (issuer.endsWith('/')) {
    855           showAlert('Issuer must not end with a slash.');
    856           issuerInput.focus();
    857           return;
    858         }
    859         if (!issuer.slice(8).includes('.')) {
    860           showAlert('Issuer must include a complete hostname.');
    861           issuerInput.focus();
    862           return;
    863         }
    864         if (!clientId || /\s/.test(clientId)) {
    865           showAlert('Client id is required and must not contain spaces.');
    866           clientIdInput.focus();
    867           return;
    868         }
    869 
    870         window.location.href = listUrl(`saved=${encodeURIComponent(isEdit ? provider.slug : slug)}`);
    871       });
    872 
    873       setRole(currentRole);
    874       applyChrome();
    875       syncDomainOptions();
    876     </script>
    877     <script src="./shell.js"></script>
    878   </body>
    879 </html>