The Bidco LoginManager provides a secure and easy way for people to log into your app and manage their Bidco Profile.

To facilitate seamless engagement, you can create an temporary profile for users that do not have an existing Bidco profile. This temporary profile requires no personal user information upfront because the profile is tied to the device.

The temporary profile can later be saved allowing the user to use their newly created Bidco account across multiple devices. However, if the application is deleted or the data is cleared before the profile is saved the account will be irrevocably lost.

The LoginManager can be used to do the following:

Log In as a Guest

A temporary or guest user profile lets you build a frictionless Bidco experience by allowing users to start making payments without requiring a Bidco account. Guest accounts are deleted after an hour of inactivity.

  1. Log in as an anonymous guest user using the LoginManager:
LoginManager loginManager = ManagerFactory.GetInstance().LoginManager;
AccessToken accessToken = await loginManager.SignInAsGuestAsync();
// User is now logged in
Profile profile = ProfileManager.GetInstance().CurrentProfile;
Baskets baskets = BasketsManager.GetInstance().CurrentBaskets;

  1. The access token for the currently authenticated user can be retrieved using:
AccessToken accessToken = loginManager.GetCurrentAccessToken();

Note: To make the guest profile permanent, all that is needed is to update the profile with some details and then save it. For details on how to do this read User Profiles

Log into an Existing Bidco Profile

An existing Bidco user can log in and immediately begin making payments using the payment instruments stored in their Bidco profile.

There are four ways an existing user can log in using the SDK:

  1. Log In Using a Profile ID
ProfileIdSignInDetails profileIdSignInDetails = new ProfileIdSignInDetails(signInDiag.ProfileId, signInDiag.Password);
Profile profile = await loginManager.SignInAsync(profileIdSignInDetails);
// User is now logged in

  1. Log In Using a Mobile Number
MobileNumberSignInDetails mobileNumberSignInDetails = new MobileNumberSignInDetails(signInDiag.MobileNumber, signInDiag.Password);
Profile profile = await loginManager.SignInAsync(mobileNumberSignInDetails);
// User is now logged in

Note: It is only possible to log in using a mobile number if the profile has been updated with one.

  1. Log In Using an Email Address
EmailSignInDetails emailSignInDetails = new EmailSignInDetails(signInDiag.Email, signInDiag.Password);
Profile profile = await loginManager.SignInAsync(emailSignInDetails);
// User is now logged in

Note: It is only possible to log in using an email address number if the profile has been updated with one.

  1. Log In Using a Proxy UserId

You are able to use your own application identifier for the current user to log in.

ProxyUserIdSignInDetails proxyUserIdSignInDetails = new ProxyUserIdSignInDetails(sysconf.UserName, sysconf.Password);
Profile profile = await loginManager.SignInAsync(proxyUserIdSignInDetails);
// User is now logged in

Note: It is only possible to log in using the proxyUserId if one has been set in the profile.

For details on the getter and setter methods available please see the SDK reference documentation.

After Logging In

Once the user is logged in you can retrieve and modify the Profile, detect Bidco tags that trigger different workflows.

Checking if the User is Logged In

  1. Check if the user has a current access token:
if (LoginManager.GetInstance().IsLoggedIn) {
	// User is already logged in
} else {
	// Go to login screen

Log Out

Log out from the current profile, removing the current AccessToken, baskets and profile data from memory. If the current profile is a temporary profile, all personal user information associated with that account will be deleted.

  1. Log out using LoginManager:
LoginManager loginManager = LoginManager.GetInstance();
await loginManager.LogoutAsync();
// User is now logged out