forgejo/services/context
Erwan Leboucher 0211c1eace feat: persist OAuth2/OIDC sign-in via IdP re-validation (#12321)
The session cookie has no Max-Age, so it is lost when the browser closes. The password flow compensates via a "Remember me" checkbox issuing an LTA cookie; OAuth2/OIDC sign-in had no such UI.

Issuing a regular LTA cookie after an OAuth callback would skip the IdP for LOGIN_REMEMBER_DAYS. Instead, this introduces a separate LongTermAuthorizationSSO purpose: the cookie is opt-in via the existing "Remember me" checkbox, and when presented without a session, autoSignIn redirects through the IdP with OIDC prompt=none for silent re-auth. On login_required / interaction_required / consent_required / account_selection_required
we transparently fall back to interactive sign-in.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/12321
Reviewed-by: Mathieu Fenniak <mfenniak@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2026-05-15 02:31:20 +02:00
..
upload
access_log.go
api.go
api_org.go
api_test.go
base.go
base_test.go
captcha.go
context.go
context_cookie.go feat: persist OAuth2/OIDC sign-in via IdP re-validation (#12321) 2026-05-15 02:31:20 +02:00
context_model.go
context_request.go
context_response.go
context_test.go
org.go fix(web): org projects assignment in issue view (#7999) 2026-05-02 01:29:40 +02:00
package.go
pagination.go
permission.go 2026-05-12 security patches (#12493) 2026-05-12 04:54:25 +02:00
private.go
quota.go
repo.go 2026-05-12 security patches (#12493) 2026-05-12 04:54:25 +02:00
repository.go
response.go
user.go
utils.go