Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page

Show all

Login Using an App ID

Updated on 2024-12-27 GMT+08:00
1
HWMSdk.getOpenApi.loginByAppId(AppIdAuthParam,HwmCallback)

API Description

This API is used for login using an app ID.

Precautions

You can join a meeting anonymously. However, if you want to use other services, you must log in first.

NOTE:

After the login is successful, the callback onSuccess is invoked.

Method Definition

1
2
3
4
5
6
    /**
     * Logs in.
     * @param appIdAuthParam Indicates the appIdAuthParam object.
     * @param hwmCallback Indicates the result callback.
     */
void loginByAppId(AppIdAuthParam appIdAuthParam, HwmCallback<LoginResult> hwmCallback)

Parameter Description

Table 1 Parameter description

Parameter

Mandatory

Type

Description

appIdAuthParam

Yes

AppIdAuthParam

appIdAuthParam object.

hwmCallback

Yes

HwmCallback<LoginResult>

Callback object.

Return Values

None

Parameter Extension

Table 2 AppIdAuthParam description

Parameter

Mandatory

Type

Description

thirdUserId

Yes

String

Unique ID of a third-party account. The value contains 1 to 64 characters.

Note: When the app ID authentication mode is used, ensure that the app ID has been applied for on the meeting server. When the app ID is passed using HWMSdk.init, the OpenSdkConfig parameter must be transferred using OpenSdkCOnfig.setAppId(appid).

nonce

Yes

String

A random character string consisting of 32 to 64 characters.

corpId

No

String

ID of the enterprise to which the user belongs. This parameter is mandatory only in SP mode. Do not set this parameter in single-enterprise mode. Otherwise, the authentication will fail.

signature

Yes

String

Signature information.

expireTime

Yes

long

Signature expiration time. The value is a Unix timestamp, in seconds. If the value is 0, the signature will not expire.

userName

No

String

Username. If this parameter is left blank, the value of this parameter is the same as that of thirdUserId by default.

userEmail

No

String

Email address of the user.

userPhone

No

String

Mobile number of the user.

deptCode

No

String

Department code.

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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Create a login object.
AppIdAuthParam appIdAuthParam = new AppIdAuthParam();
// Set the signature expiration time. The value is a Unix timestamp, in seconds. If the value is 0, the signature will not expire.
appIdAuthParam.setExpireTime(1599618620);
// Set a random character string consisting of 32 to 64 characters.
appIdAuthParam.setNonce(getNonce());
// Set the ID of the enterprise to which the user belongs. This parameter is required only in the SP login scenario.
appIdAuthParam.setCorpId(getCorpId());
// Set the ID of the third-party account. The value contains 1 to 64 characters.
appIdAuthParam.setUserId(getUserId());
// Set signature information.
appIdAuthParam.setSignature(getSignature());
// Set the user nickname.
appIdAuthParam.setUserName(getUserName());
// Set the email address, which must meet the format requirements.
appIdAuthParam.setUserEmail(getUserEmail());
// Set the mobile number, which must be in the correct format, for example, ^$|^[+]?[0-9]+$.
appIdAuthParam.setUserPhone(getUserPhone());
// Start to log in.
HWMSdk.getOpenApi(getActivity().getApplication()).loginByAppId(appIdAuthParam, new HwmCallback<LoginResult>() {
            @Override
            public void onSuccess(LoginResult loginResult) {
                dismissLoading();
                dismiss();
                if (loginResult != null) {
                    DemoUtil.showToast("Login succeeded" + loginResult.getUserUuid());
                }else{
                    DemoUtil.showToast("Logged in");
                }
            }

            @Override
            public void onFailed(int retCode, String desc) {
                HwmContext.getInstance().runOnMainThread(() ->{
                    dismissLoading();
                    Error error = HWMBizSdk.getLoginApi().convertErrorCodeToUI(retCode);
                     DemoUtil.showToast("Login failed: "+ getLoginErrTips(error));
                    dismiss();
                });
            }
        });

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback