TsgcWSAPIServer_WebAuthnMethods › IsWebAuthnUnauthorized

IsWebAuthnUnauthorized Method

Returns True when the connection is not authorized and a 401 response must be sent.

Syntax

function IsWebAuthnUnauthorized(aConnection: TsgcWSConnection): Boolean;

Parameters

NameTypeDescription
aConnectionTsgcWSConnectionConnection whose authorization state must be inspected.

Return Value

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)

Remarks

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.

Example

if sgcWSAPIServer_WebAuthn1.IsWebAuthnUnauthorized(aConnection) then
  aResponseInfo.ResponseNo := 401;

Back to Methods