.Authenticate()
Authenticates the current connection with a JWT token.
Method Syntaxawait db.Authenticate(jwt)
Arguments | Description | ||
---|---|---|---|
jwt required | The JWT object holder of the authentication token. | ||
cancellationToken optional | The cancellationToken enables graceful cancellation of asynchronous operations. |
Jwt jwt = new JWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJTdXJyZWFsREIiLCJpYXQiOjE1MTYyMzkwMjIsIm5iZiI6MTUxNjIzOTAyMiwiZXhwIjoxODM2NDM5MDIyLCJOUyI6InRlc3QiLCJEQiI6InRlc3QiLCJTQyI6InVzZXIiLCJJRCI6InVzZXI6dG9iaWUifQ.N22Gp9ze0rdR06McGj1G-h2vu6a6n9IVqUbMFJlOxxA"); await db.Authenticate(jwt);
You can invalidate the authentication for the current connection using the Invalidate()
method.