Commit c7b0a31
committed
feat: surface Google SSO on the login page
Google Workspace SSO is fully implemented server-side — /auth/google/start
and /auth/google/callback exist, are permitAll in SecurityConfig, and are
gated by a google_workspace_domain allowlist that verifies the OIDC `hd`
claim. The client helper authAPI.getGoogleStartUrl() exists too.
Nothing ever called it. Login.jsx had no Google reference at all, so on an
install with SECURITY_GOOGLE_ENABLED=true the only way to sign in via SSO
was to type /api/auth/google/start into the address bar.
The login page is unauthenticated, so it cannot read security.google.enabled
to decide whether to offer the button. Rather than add an endpoint, this
extends GET /setup/status — already public, and already fetched by Login.jsx
on mount — with a googleEnabled flag. Installs that never configured Google
see no button and are unaffected.
- SetupController: expose googleEnabled on the public status response.
Field is non-final by necessity; @requiredargsconstructor would otherwise
pull it into the constructor, which Spring cannot satisfy.
- Login.jsx: render a "Sign in with Google" button below the password form
when the flag is set. Plain <a>, not a submit button — the endpoint 302s
to Google, so it is a full-page navigation and must not post the form.1 parent b99d1b2 commit c7b0a31
2 files changed
Lines changed: 56 additions & 2 deletions
Lines changed: 17 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
37 | 49 | | |
38 | 50 | | |
39 | 51 | | |
| |||
53 | 65 | | |
54 | 66 | | |
55 | 67 | | |
56 | | - | |
| 68 | + | |
| 69 | + | |
57 | 70 | | |
58 | 71 | | |
59 | 72 | | |
| |||
278 | 291 | | |
279 | 292 | | |
280 | 293 | | |
281 | | - | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
282 | 297 | | |
283 | 298 | | |
284 | 299 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| 102 | + | |
102 | 103 | | |
103 | 104 | | |
104 | 105 | | |
| |||
147 | 148 | | |
148 | 149 | | |
149 | 150 | | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
150 | 189 | | |
151 | 190 | | |
152 | 191 | | |
| |||
0 commit comments