Authentication
In order to use the features of Sendbird UIKit for Flutter in your client apps, a SendbirdUIKit
instance must be initiated in each client app through user authentication with Sendbird server. The instance communicates and interacts with the server using an authenticated user account, and is allowed to use the UIKit's features. This page explains how to authenticate your user with the server.
--
Overview
Authentication is required to use Sendbird’s features. There are three ways to authenticate:
- Guest Login: A token is not required. However, this method is not recommended for production due to security vulnerabilities. You use a UserID only to authenticate.
Note: You can turn off this feature in Access token permission on Sendbird Dashboard.
-
Access Token: A token that does not expire. It can be generated by API or from the Dashboard.
-
Session Token: Highly recommended for enhanced security.
Note: This document does not cover session handling. Refer to this SDK document to learn more.
Connect to Sendbird server
Connect a user to Sendbird server using the SendbirdUIKit.connect()
method. The connect()
method also automatically updates the user profile on the server.
Refer to the code below to see how to connect a user to Sendbird server:
Disconnect from Sendbird server
Call the SendbirdUIKit.disconnect()
method if the user requests to log out. If a user has been logged out and thus disconnected from the server, they will no longer receive messages.