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:
2026-11-25 13:00:36 -07:00
co-authored by Claude Opus 5.5
parent 637ef1cc25
commit 962dbe3286
19 changed files with 1458 additions and 15 deletions
+11 -1
View File
@@ -207,10 +207,20 @@ func (s *Server) startSession(w http.ResponseWriter, r *http.Request, u *users.U
return errors.New("you aren't in any team that's open")
}
}
token, _, err := users.StartSessionIn(s.platform(), u.ID, team, clientIP(r), r.UserAgent(), time.Now())
return s.startSessionIn(w, r, u, team, "password")
}
// startSessionIn signs a user in to a team, recording how (password, core).
func (s *Server) startSessionIn(w http.ResponseWriter, r *http.Request, u *users.User, team int64, via string) error {
token, sess, err := users.StartSessionIn(s.platform(), u.ID, team, clientIP(r), r.UserAgent(), time.Now())
if err != nil {
return err
}
if via != "password" {
if err := users.SetVia(s.platform(), sess.ID, via); err != nil {
return err
}
}
if err := users.SignedIn(s.platform(), u.ID, time.Now()); err != nil {
return err
}