Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/docs
diff options
context:
space:
mode:
authorLeitwolf112026-10-16 16:13:45 +0300
committerLeitwolf112026-10-16 16:13:45 +0300
commit031cbf7efc5d97b28259da5b387cb3a3dbd242d5 (patch)
tree44077b255fdf019e82d6960ba30e70c3a59a954a /docs
parent8f58831373b72dc5b60bad649a961acd0bb94aa4 (diff)
downloadprogmaweb-031cbf7efc5d97b28259da5b387cb3a3dbd242d5.tar.gz
Log why a Google callback could not finish
A failed Google callback has returned the visitor to /login?google=failed since the previous release, but nothing recorded why: a declined consent, an expired or missing state cookie and a forged request all looked the same, and the log of the service held no entry at all. GoogleSignInFailure now handles OnRemoteFailure. It writes one warning, event GoogleSignInFailed (id 5), with the cause: the error code Google reported, such as access_denied, or the reason the handler refused the callback, such as "The oauth state was missing or invalid." An error code is written only when it is a short run of letters, digits, '_', '-' and '.'; anything else from the query string is written as an unrecognized error. The authorization code, the state and tokens are never logged. The redirect is unchanged. Four new tests cover the entry, the redirect, an unusual error value and a refused state. The account API document describes the log entry.
Diffstat (limited to 'docs')
-rw-r--r--docs/ACCOUNT-API.md5
1 files changed, 5 insertions, 0 deletions
diff --git a/docs/ACCOUNT-API.md b/docs/ACCOUNT-API.md
index 0bf05e9..68186b5 100644
--- a/docs/ACCOUNT-API.md
+++ b/docs/ACCOUNT-API.md
@@ -99,6 +99,11 @@ The flow is a server-side authorization-code flow. The browser is redirected; it
| the email address of the identity belongs to another account | redirect to `/login?google=failed` |
| Google reported no usable identity, or the callback failed | redirect to `/login?google=failed` |
+The visitor sees one message for every cause. When the callback itself fails, the service logs the cause as a
+warning with the event `GoogleSignInFailed` (event id 5): the error Google reported, such as `access_denied`, or the
+reason the callback was refused, such as a missing or invalid state. The entry never contains the authorization code,
+the state or a token.
+
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.