✅ [BORA Network] Login & Connect

To reduce the churn rate of the Bora connect process, there are some special APIs that perform a Bora connect while creating FaceWallet.

🚧

This API only works for the firt time signup user

These APIs made users connect to Bora Portal only when the user creates Face Wallet first time. If the user already had an Face Wallet account, this API does not connect Bora Portal. You should call face.Bora().Connect for existing users.

You can safely call these APIs for already signed up user, but then these APIs does not make user connect with Bora.

📘

Please read other articles first

You should read Login section(link) and Bora Connect(link) section in the document first, to understand this document.

BoraLoginWithIdToken

BoraLoginWithIdToken does the same things as LoginWithIdtoken(link). If a user is first signed up, this API makes the user connect to BoraPortal in the sign-up process. To create the bappUsnSignature read this link but the message is `$"boraconnect:{bappUsn}". For example, if the bappUsn is XYZ, the message is boraconnect:XYZ

string idToken = "id_token"; // issued from googe or face supported providers
string sig = "id_token_sig"; // signed idToken by API Secret
FaceLoginIdTokenRequest faceLoginIdTokenRequest = new FaceLoginIdTokenRequest(idToken, sig);

string bappUsn = "unique_game_id"; // unique user id in game
string bappUsnSignature = "bora_connect_sign"; // signature of $"boraconnect:{bappUsn}"
string boraPortalConnectRequest = new BoraPortalConnectRequest(
    bappUsn, bappUsnSignature);
FaceLoginResponse response = await this._face.Auth().BoraLoginWithIdToken(
            faceLoginIdTokenRequest, boraPortalConnectRequest);

if (response.boraPortalConnectStatusResponse != null) {
  // Connecting to bora portal succeed
  // use fields in response.boraPortalConnectStatusResponse
}

BoraDirectSocialLogin

BoraDirectSocialLogindoes the same things as DirectSocialLogin(link). If a user is first signed up, this API makes the user connect to BoraPortal in the sign-up process. To create the bappUsnSignature read this link but the message is$"boraconnect:{bappUsn}". For example, if the bappUsn is XYZ, the message is boraconnect:XYZ

var provider = LoginProviderType.Google;
string bappUsn = "unique_game_id"; // unique user id in game
string bappUsnSignature = "bora_connect_sign"; // signature of $"boraconnect:{bappUsn}"
string boraPortalConnectRequest = new BoraPortalConnectRequest(
    bappUsn, bappUsnSignature);

FaceLoginResponse response = await this._face.Auth().BoraDirectSocialLogin(provider, boraPortalConnectRequest);

if (response.boraPortalConnectStatusResponse != null) {
  // Connecting to bora portal succeed
  // use fields in response.boraPortalConnectStatusResponse
}

BoraLogin

BoraLogin does the same things as Login(link). If a user is first signed up, this API makes the user connect to BoraPortal in the sign-up process. To create the bappUsnSignature read this link but the message is$"boraconnect:{bappUsn}". For example, if the bappUsn is XYZ, the message is boraconnect:XYZ

List<LoginProviderType> providers = new List<LoginProviderType>() { LoginProviderType.Google, LoginProviderType.Apple };
string bappUsn = "unique_game_id"; // unique user id in game
string bappUsnSignature = "bora_connect_sign"; // signature of $"boraconnect:{bappUsn}"
string boraPortalConnectRequest = new BoraPortalConnectRequest(
    bappUsn, bappUsnSignature);

FaceLoginResponse response = await this._face.Auth().BoraLogin(providers, boraPortalConnectRequest);


if (response.boraPortalConnectStatusResponse != null) {
  // Connecting to bora portal succeed
  // use fields in response.boraPortalConnectStatusResponse
}