Class WebsocketAuthenticatorAbstract

Authenticators are used to check authentication when a client either sends a request (route) or when data should be sent to the client (outbound). Override the authenticate method to implement authentication functionality.

Hierarchy

  • WebsocketAuthenticator

Constructors

Properties

andAuthenticator: WebsocketAuthenticator = null

Can contain a reference to another authenticator. When this authenticator instance is used for authentication, this authenticator and the referred authenticator need to grant permission.

label: string

A label that represents the authenticator.

orAuthenticator: WebsocketAuthenticator = null

Can contain a reference to another authenticator. When this authenticator instance is used for authentication, either this authenticator or the referred authenticator need to grant permission.

unauthenticatedMessage: string

The message to send when the client is not authenticated.

Methods

  • Authenticates the WebSocket connection.

    Parameters

    • conn: string | WebsocketConnection

      The WebSocket connection or its identifier.

    • requestData: any

      Additional data associated with the request.

    Returns Promise<boolean>

    A Promise that resolves to a boolean indicating if the authentication is successful.

  • Checks the authentication for the WebSocket connection.

    Parameters

    • conn: string | WebsocketConnection

      The WebSocket connection or its identifier.

    • requestData: any

      Additional data associated with the request.

    Returns Promise<boolean>

    A Promise that resolves to a boolean indicating if the authentication is successful.

Generated using TypeDoc