{"Entry":{"collection":"hook","key":"clientauthentication_hook","name":"ClientAuthentication_hook","aliases":[],"metadata":{"aliases":[],"category":"Authentication and connections","content_hash":"ffb7f90abd6354eec46a90a9341b34dc08a1bace366c386eef1a70dbfd87c0b7","imported_at":"2026-09-27T17:57:58.826579+08:00","name":"ClientAuthentication_hook","name_zh":"ClientAuthentication_hook","slug":"clientauthentication_hook","summary":"Hook for plugins to get control in ClientAuthentication()"}},"Definition":{"Collection":"hook","Key":"clientauthentication_hook","SourceDatabase":"center","Version":"18","SourceTable":"hook","SourceKey":"clientauthentication_hook","SourceRevision":"753057e340da8f22e57c9a409ea7a235fd6a46bd","Facts":{"description":["Hook for plugins to get control in ClientAuthentication()"],"facts":[{"label":"Interface type","value":"ClientAuthentication_hook_type"},{"label":"Header","value":"src/include/libpq/auth.h"},{"label":"Subsystem","value":"Authentication and connections"},{"label":"Initial value","value":"NULL (no hook installed)"}],"related":[],"release":{"channel":"stable","label":"18","major":"18","ref":"REL_18_STABLE","revision":"753057e340da8f22e57c9a409ea7a235fd6a46bd"},"sections":[{"paragraphs":["This hook allows plugins to get control following client authentication, but before the user has been informed about the results. It could be used to record login events, insert a delay after failed authentication, etc."],"title":"Core source comments"},{"paragraphs":["src/backend/libpq/auth.c:664"],"title":"Call sites"},{"code":"\t\t\t\t\t   \"(%s:%d)\",\n\t\t\t\t\t   port-\u003euser_name, hba_authname(port-\u003ehba-\u003eauth_method),\n\t\t\t\t\t   port-\u003ehba-\u003esourcefile, port-\u003ehba-\u003elinenumber));\n\t}\n\n\tif (ClientAuthentication_hook)\n\t\t(*ClientAuthentication_hook) (port, status);\n\n\tif (status == STATUS_OK)\n\t\tsendAuthRequest(port, AUTH_REQ_OK, NULL, 0);\n\telse\n\t\tauth_failed(port, status, logdetail);\n}\n\n","paragraphs":[],"title":"Core call context: src/backend/libpq/auth.c:658–672"}],"signature":"typedef void (*ClientAuthentication_hook_type) (Port *, int);\nextern PGDLLIMPORT ClientAuthentication_hook_type ClientAuthentication_hook;","sources":[{"label":"Interface declaration","path":"src/include/libpq/auth.h","sha256":"976773a9612d289da53c43129ef0438a57904cdd19ffa2ca3d6d2b00104ec241","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/include/libpq/auth.h#L45"},{"label":"Core definition","path":"src/backend/libpq/auth.c","sha256":"94252cb1e2c49b0ddb15f6596d0abf8056c84493de07cc81439da4c5b07018f1","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/libpq/auth.c#L223"},{"label":"Call sites","path":"src/backend/libpq/auth.c","sha256":"94252cb1e2c49b0ddb15f6596d0abf8056c84493de07cc81439da4c5b07018f1","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/libpq/auth.c#L664"}]},"ManualEvidence":{"release":{"channel":"stable","label":"18","major":"18","ref":"REL_18_STABLE","revision":"753057e340da8f22e57c9a409ea7a235fd6a46bd"},"sources":[{"label":"Interface declaration","path":"src/include/libpq/auth.h","sha256":"976773a9612d289da53c43129ef0438a57904cdd19ffa2ca3d6d2b00104ec241","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/include/libpq/auth.h#L45"},{"label":"Core definition","path":"src/backend/libpq/auth.c","sha256":"94252cb1e2c49b0ddb15f6596d0abf8056c84493de07cc81439da4c5b07018f1","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/libpq/auth.c#L223"},{"label":"Call sites","path":"src/backend/libpq/auth.c","sha256":"94252cb1e2c49b0ddb15f6596d0abf8056c84493de07cc81439da4c5b07018f1","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/libpq/auth.c#L664"}]},"MeasuredEvidence":{}},"Text":{"Collection":"hook","Key":"clientauthentication_hook","SourceDatabase":"center","Version":"18","Locale":"en","Title":"ClientAuthentication_hook","Summary":"Hook for plugins to get control in ClientAuthentication()","BodyHTML":"\u003cp\u003eHook for plugins to get control in ClientAuthentication()\u003c/p\u003e","SourceRevision":"753057e340da8f22e57c9a409ea7a235fd6a46bd","ContentHash":"20360f5144e687f2af3cc976350717a44c42a6a1b0a7172ee415166576967061","Payload":{"description":["Hook for plugins to get control in ClientAuthentication()"],"related":[],"sections":[{"paragraphs":["This hook allows plugins to get control following client authentication, but before the user has been informed about the results. It could be used to record login events, insert a delay after failed authentication, etc."],"title":"Core source comments"},{"paragraphs":["src/backend/libpq/auth.c:664"],"title":"Call sites"},{"code":"\t\t\t\t\t   \"(%s:%d)\",\n\t\t\t\t\t   port-\u003euser_name, hba_authname(port-\u003ehba-\u003eauth_method),\n\t\t\t\t\t   port-\u003ehba-\u003esourcefile, port-\u003ehba-\u003elinenumber));\n\t}\n\n\tif (ClientAuthentication_hook)\n\t\t(*ClientAuthentication_hook) (port, status);\n\n\tif (status == STATUS_OK)\n\t\tsendAuthRequest(port, AUTH_REQ_OK, NULL, 0);\n\telse\n\t\tauth_failed(port, status, logdetail);\n}\n\n","paragraphs":[],"title":"Core call context: src/backend/libpq/auth.c:658–672"}]}},"RequestedLocale":"zh-Hans","Fallback":true,"Versions":["10","11","12","13","14","15","16","17","18","19","20"],"Locales":["en"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
