• Start

Languages

/

PHP

/

Methods

authenticate

Authenticate the current connection with a JWT token using the authenticate method in the SurrealDB PHP SDK.

Authenticates the current connection with a JWT token.

Method Syntax

$db->authenticate($token)
ArgumentsTypeDescription
token string The JWT authentication token.
$db->authenticate('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJTdXJyZWFsREIiLCJpYXQiOjE1MTYyMzkwMjIsIm5iZiI6MTUxNjIzOTAyMiwiZXhwIjoxODM2NDM5MDIyLCJOUyI6InRlc3QiLCJEQiI6InRlc3QiLCJTQyI6InVzZXIiLCJJRCI6InVzZXI6dG9iaWUifQ.N22Gp9ze0rdR06McGj1G-h2vu6a6n9IVqUbMFJlOxxA');

You can invalidate the authentication for the current connection using the invalidate() method.

Was this page helpful?