/** * Make a login request. * * @param params custom login params * @param callback the asynchronous callback */ public void login(LoginParams params, final ApiCallback<Credentials> callback) { login(params, callback, "login with a " + params.getClass().getSimpleName() + " object"); }
/** * Attempt to login with username/password * * @param user the username * @param password the password * @param deviceName the device name * @param deviceId the device id, used for e2e encryption * @param callback the callback success and failure callback */ public void loginWithUser(final String user, final String password, final String deviceName, @Nullable final String deviceId, final ApiCallback<Credentials> callback) { final String description = "loginWithUser : " + user; PasswordLoginParams params = new PasswordLoginParams(); params.setUserIdentifier(user, password); params.setDeviceName(deviceName); params.setDeviceId(deviceId); login(params, callback, description); }
/** * Attempt to login with 3pid/password * * @param medium the medium of the 3pid * @param address the address of the 3pid * @param password the password * @param deviceName the device name * @param deviceId the device id, used for e2e encryption * @param callback the callback success and failure callback */ public void loginWith3Pid(final String medium, final String address, final String password, final String deviceName, @Nullable final String deviceId, final ApiCallback<Credentials> callback) { final String description = "loginWith3pid : " + address; PasswordLoginParams params = new PasswordLoginParams(); params.setThirdPartyIdentifier(medium, address, password); params.setDeviceName(deviceName); params.setDeviceId(deviceId); login(params, callback, description); }
/** * Attempt to login with phone number/password * * @param phoneNumber the phone number * @param countryCode the ISO country code * @param password the password * @param deviceName the device name * @param deviceId the device id, used for e2e encryption * @param callback the callback success and failure callback */ public void loginWithPhoneNumber(final String phoneNumber, final String countryCode, final String password, final String deviceName, @Nullable final String deviceId, final ApiCallback<Credentials> callback) { final String description = "loginWithPhoneNumber : " + phoneNumber; PasswordLoginParams params = new PasswordLoginParams(); params.setPhoneIdentifier(phoneNumber, countryCode, password); params.setDeviceName(deviceName); params.setDeviceId(deviceId); login(params, callback, description); }