TsgcWSAPIServer_WebAuthn › Methods › IsWebAuthnUnauthorized
Returns True when the connection is not authorized and a 401 response must be sent.
function IsWebAuthnUnauthorized(aConnection: TsgcWSConnection): Boolean;
| Name | Type | Description |
|---|---|---|
aConnection | TsgcWSConnection | Connection whose authorization state must be inspected. |
True when the connection has no valid WebAuthn token (or the token has expired) and the request must be rejected with HTTP 401; False when the connection is authorized. (Boolean)
Helper used by the server pipeline to decide whether to emit the standard 401 Unauthorized response and fire the OnWebAuthnUnauthorized event. Can also be called from user code to gate access to protected resources.
if sgcWSAPIServer_WebAuthn1.IsWebAuthnUnauthorized(aConnection) then
aResponseInfo.ResponseNo := 401;