Phase 12: signing in with the Core's Authelia
Admins make the client's secret under Settings → Sign-in, which shows the entry for the Core's idproviders.yml (the secret's PBKDF2-SHA512 hash, the redirect address, PKCE). People sign in with their Core account: invited ones are matched by verified email, then by subject; optionally anyone at the Core's domain joins. Passwords can be turned off but for the owner's, and signing out ends the Core's session where it can. On multi-tenant, the team is found by its proved domain. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -18,6 +18,10 @@
|
||||
</fieldset>{{end}}
|
||||
<button type="submit">Join</button>
|
||||
</form>
|
||||
{{with .Core}}<form class="card" method="post" action="/signin/core">
|
||||
<p>Or join with your account at <strong>{{.}}</strong>, with no password here:</p>
|
||||
<button type="submit" class="secondary">Sign in with {{.}}</button>
|
||||
</form>{{end}}
|
||||
{{else}}
|
||||
<h1>This invitation doesn't work</h1>
|
||||
<section class="card">
|
||||
|
||||
@@ -154,6 +154,7 @@
|
||||
{{if $.Can "admin"}}
|
||||
<div class="nav-label">Company</div>
|
||||
<a href="/settings/profile" {{if eq .Nav "settings/profile"}}aria-current="page"{{end}}>{{template "icon" "profile"}}Profile</a>
|
||||
{{with $.Viewer}}{{if .User}}<a href="/settings/signin" {{if eq $.Nav "settings/signin"}}aria-current="page"{{end}}>{{template "icon" "core"}}Sign-in</a>{{end}}{{end}}
|
||||
{{if $.Multi}}<a href="/settings/domain" {{if eq .Nav "settings/domain"}}aria-current="page"{{end}}>{{template "icon" "sites"}}Domain</a>{{end}}
|
||||
<div class="nav-label">Connections</div>
|
||||
<a href="/settings/connections" {{if eq .Nav "settings/connections"}}aria-current="page"{{end}}>{{template "icon" "core"}}All connections</a>
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
{{define "content"}}{{template "settings-start" .}}{{with .Data}}
|
||||
<h2>Sign-in</h2>
|
||||
<p class="lede">People can sign in with their Federated Core account, through the Core's Authelia (OpenID Connect), as well as, or instead of, a password here.</p>
|
||||
{{with .Problem}}<p class="error" role="alert">{{.}}</p>{{end}}
|
||||
{{with .Tested}}<p class="flash" role="status">{{.}}</p>{{end}}
|
||||
{{if not .Core}}
|
||||
<section class="card"><p>First enter the Core's domain under <a href="/settings/core">Core & Hermes</a>.</p></section>
|
||||
{{else}}
|
||||
<section class="card">
|
||||
<h3>1. The client</h3>
|
||||
<dl class="facts">
|
||||
<dt>Issuer</dt><dd><code>{{.Issuer}}</code></dd>
|
||||
<dt>Redirect address</dt><dd><code>{{.Callback}}</code></dd>
|
||||
</dl>
|
||||
<form method="post" action="/settings/signin/secret" class="row wrap">
|
||||
<label class="small">Client ID <input name="client_id" value="{{.C.ClientID}}" size="16"></label>
|
||||
<button type="submit" class="secondary" {{if .C.Hash}}data-confirm="Make a new secret? The entry on the Core must then be changed too."{{end}}>{{if .C.Hash}}Make a new secret{{else}}Make the client's secret{{end}}</button>
|
||||
</form>
|
||||
<p class="help">Supermarket keeps the secret, encrypted; only its hash goes to the Core.</p>
|
||||
</section>
|
||||
{{with .Block}}
|
||||
<section class="card" id="block">
|
||||
<h3>2. On the Core</h3>
|
||||
<p>The Core's admin adds this entry under <code>identity_providers.oidc.clients</code> in Authelia's <code>idproviders.yml</code>, beside the other services', then restarts Authelia:</p>
|
||||
<pre id="client-block">{{.}}</pre>
|
||||
<button type="button" class="secondary small" data-copy="client-block">Copy</button>
|
||||
</section>
|
||||
<section class="card">
|
||||
<h3>3. Test, and turn it on</h3>
|
||||
<form method="post" action="/settings/signin/test"><button type="submit" class="secondary">Test</button> <span class="help">Reads Authelia's discovery document.</span></form>
|
||||
<form method="post" action="/settings/signin/save">
|
||||
<label class="small">Issuer, if not <code>https://authelia.{{$.Data.Domain}}</code> <input name="issuer" value="{{$.Data.C.Issuer}}" placeholder="https://authelia.{{$.Data.Domain}}"></label>
|
||||
<label class="check"><input type="checkbox" name="enabled" {{if $.Data.C.Enabled}}checked{{end}}> <span>People may sign in with the Core</span></label>
|
||||
<label class="check"><input type="checkbox" name="require_core" {{if $.Data.C.RequireCore}}checked{{end}}> <span>Only with the Core: passwords are off, except the owner's (a way in if the Core is down)</span></label>
|
||||
<label class="check"><input type="checkbox" name="auto_join" {{if $.Data.C.AutoJoin}}checked{{end}}> <span>Anyone with an address at <strong>{{$.Data.Domain}}</strong> may join, as a member with these modules:</span></label>
|
||||
{{template "access-fields" (dict "Role" "member" "Modules" $.Data.C.AutoModules "Grants" $.Data.Grants)}}
|
||||
<p class="help">Otherwise only people invited may sign in: matched by their email the first time, then by their account at the Core.</p>
|
||||
<button type="submit">Save</button>
|
||||
</form>
|
||||
</section>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{end}}{{template "settings-end"}}{{end}}
|
||||
@@ -20,6 +20,22 @@
|
||||
<label>Password <input type="password" name="password" autocomplete="current-password" required {{if .Email}}autofocus{{end}}></label>
|
||||
<button type="submit">Sign in</button>
|
||||
</form>
|
||||
{{if .Core}}
|
||||
<form class="card" method="post" action="/signin/core">
|
||||
<input type="hidden" name="next" value="{{.Next}}">
|
||||
<button type="submit" class="secondary">Sign in with {{.Core}}</button>
|
||||
<p class="help">Your Core's account, with its own two-factor sign-in if it has one.</p>
|
||||
</form>
|
||||
{{else if .CoreMulti}}
|
||||
<details class="card">
|
||||
<summary>Sign in with your Core</summary>
|
||||
<form method="post" action="/signin/core">
|
||||
<input type="hidden" name="next" value="{{.Next}}">
|
||||
<label>Your company's website <input name="domain" placeholder="example.com" required></label>
|
||||
<button type="submit" class="secondary">Continue to your Core</button>
|
||||
</form>
|
||||
</details>
|
||||
{{end}}
|
||||
<p class="help"><a href="/forgot{{with .Email}}?email={{.}}{{end}}">Forgotten your password?</a>{{if $.Multi}} · New here? <a href="/signup">Set up your team</a>{{end}}</p>
|
||||
{{end}}
|
||||
{{end}}{{end}}
|
||||
|
||||
Reference in New Issue
Block a user