diff options
| author | Leitwolf | 2026-10-03 20:12:23 +0300 |
|---|---|---|
| committer | GitHub | 2026-10-03 20:12:23 +0300 |
| commit | 933244cc0fa149427d22d06be4d226c0a67e8b80 (patch) | |
| tree | 048ae623f49cc5f2f94234d747351f9e659f5267 /docs | |
| parent | cf444eb3bccf99c10f59ed5330b61c0397e0aeaa (diff) | |
| parent | b84a2216c26cc5392d0dc300b7a605ccb288d8c8 (diff) | |
| download | progmaweb-933244cc0fa149427d22d06be4d226c0a67e8b80.tar.gz | |
Merge pull request #27 from Progmasoft/fix/api-without-google
Run the account API without a Google client
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ACCOUNT-API.md | 8 | ||||
| -rw-r--r-- | docs/DEVELOPMENT.md | 14 | ||||
| -rw-r--r-- | docs/LIMITATIONS.md | 12 |
3 files changed, 10 insertions, 24 deletions
diff --git a/docs/ACCOUNT-API.md b/docs/ACCOUNT-API.md index 022c958..a6861fd 100644 --- a/docs/ACCOUNT-API.md +++ b/docs/ACCOUNT-API.md @@ -102,7 +102,9 @@ The flow is a server-side authorization-code flow. The browser is redirected; it A Google identity is never linked to an existing account by email address. Password registrations do not verify the address, so linking by address could give one person's account to another. -The service needs a Google client identifier and secret to run at all; see [Known limitations](LIMITATIONS.md). +Google sign-in exists only when both the client identifier and the client secret are configured when the service +starts. Without them the rest of the service works, `start` answers **503 Service Unavailable**, `complete` redirects +to `/login?google=failed`, and the callback path is not a route. ## Status and health @@ -137,8 +139,8 @@ The client address comes from `X-Forwarded-For`, which the service accepts from | --- | --- | --- | | `AccountSessions:LifetimeHours` | hours a session stays valid, clamped to 1–168 | `12` | | `AccountSessions:CookieName` | name of the session cookie | `__Host-ProgmasoftSession` | -| `Authentication:Google:ClientId` | Google OAuth client identifier | none; required | -| `Authentication:Google:ClientSecret` | Google OAuth client secret | none; required | +| `Authentication:Google:ClientId` | Google OAuth client identifier | empty; Google sign-in is off | +| `Authentication:Google:ClientSecret` | Google OAuth client secret | empty; Google sign-in is off | | `AllowedHosts` | host names the service answers | see `appsettings.json` | | `ASPNETCORE_URLS` | listener address | `http://127.0.0.1:5085` in production | diff --git a/docs/DEVELOPMENT.md b/docs/DEVELOPMENT.md index c5da810..022af77 100644 --- a/docs/DEVELOPMENT.md +++ b/docs/DEVELOPMENT.md @@ -32,18 +32,12 @@ pnpm install --frozen-lockfile pnpm dev ``` -Start the account API in a second terminal on the port the frontend expects. The two Google settings must not be -empty, or the API answers every request with 500; placeholder values are enough for everything except sign-in with -Google itself. +Start the account API in a second terminal on the port the frontend expects: ```text -Authentication__Google__ClientId=local-dev.apps.googleusercontent.com -Authentication__Google__ClientSecret=local-dev-placeholder dotnet run --project apps/api/Progmaweb.Api.csproj --urls http://127.0.0.1:5085 ``` -Set the two variables in the way your shell sets environment variables before running the last line. - The frontend forwards `/api/*` to `PROGMAWEB_API_ORIGIN`, which defaults to `http://127.0.0.1:5085`. Set it when the API listens elsewhere; `.env.example` shows the variable. @@ -57,8 +51,10 @@ Open the three surfaces through their development host names: Accounts created locally live in the memory of the API process and are gone when it stops. -Real sign-in with Google needs the identifier and secret of a Google OAuth client in those two variables. Never commit -the downloaded Google client file. +Sign-in with Google is optional locally. It needs the identifier and secret of a Google OAuth client in +`Authentication__Google__ClientId` and `Authentication__Google__ClientSecret`, set in the environment before the API +starts. Without them everything else works and the Google button leads to a 503 from the API. Never commit the +downloaded Google client file. ## Checks diff --git a/docs/LIMITATIONS.md b/docs/LIMITATIONS.md index b08d334..6d09e7d 100644 --- a/docs/LIMITATIONS.md +++ b/docs/LIMITATIONS.md @@ -18,18 +18,6 @@ API process. - **What closes it.** A durable implementation of `IAccountStore`. The interface already states the uniqueness and session rules such a store must keep. -## The API does not run without Google settings - -When `Authentication:Google:ClientId` or `Authentication:Google:ClientSecret` is empty, the API answers every request -with 500, including registration, sign-in with a password and the status route. The validation of the Google options -fails inside the authentication middleware, before any endpoint runs. - -- **Consequence.** The API cannot be started for local work without setting both values, and the "Google sign-in is - unavailable" answer of the start endpoint is never reached in that state. -- **Workaround.** Set both values. Placeholders are enough when Google sign-in itself is not being tested; see - [Development](DEVELOPMENT.md). -- **What closes it.** Registering the Google scheme only when it is configured. - ## Email addresses are not verified Registration accepts any well-formed address. Nothing proves that the person who registered owns it. |