Help Center/ Meeting/ Client SDK Reference/ Android SDK/ Typical Scenarios/ Scenario 2: Login Using an Account and Password
Updated on 2024-07-30 GMT+08:00
Scenario 2: Login Using an Account and Password
Description
Before using Huawei Cloud Meeting, you must complete login authentication on the server.
If you have not logged in, you can only join created meetings.
Service Process
- Call the API.
- Create a LoginParam object.
- Select a proper login type.
- Set the account and password.
- Call the login API to log in. The data in the preceding step is used as input parameters.
- Create a LoginParam object.
- Implement the callback.
Process the result in the callback.
Sample Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | // Create a login object. // It is recommended that accounts and passwords used for authentication be stored in ciphertext in the configuration file or as environment variables and be decrypted during usage. LoginParam loginParam = new LoginParam() .setLoginAuthType(LoginAuthType.Account_And_Password) .setAccount(getAccount()) // Login account .setPassword(getPassword()); // Login password // Start to log in. HWMSdk.getOpenApi(getApplication()).login(loginParam, new HwmCallback<LoginResult>() { @Override public void onSuccess(LoginResult loginResult) { Log.i(TAG, "Login succeeded"); } @Override public void onFailed(final int retCode, String desc) { HwmContext.getInstance().runOnMainThread(new Runnable() { @Override public void run() { Error error = HWMBizSdk.getLoginApi().convertErrorCodeToUI(retCode); Log.i(TAG, "Login failed: "+ error.getMessage()); } }); } }); |
Precautions
The login API can be called only after HWMSdk.init is successfully called.
Parent topic: Typical Scenarios
What is your overall rating for this page?
0
1
2
3
4
5
6
7
8
9
10
Very dissatisfiedVery satisfied
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot