SSO
LoginBySSO
API Description
This API is used for single sign-on (SSO). You need to obtain the authentication code through the GetSSOAuthorizeUrl API. GetSSOAuthorizeUrl obtains the authentication website by transferring the domain name. A user enters the account and password on the website or scans the QR code for authentication to obtain a temporary code (used for login).
Precautions
- You must log in to Huawei Cloud Meeting before using functions such as creating meetings and being invited into meetings. If you do not log in, you cannot experience complete meeting functions.
- This API is an asynchronous API. The return value only indicates whether the API is successfully called. The actual service processing result is returned in the corresponding callback function.
Method Definition
1
|
HWM_SDK_AGENT_API hwmsdk::HwmErrCode LoginBySSO(HwmSSOAuthInfo *ssoAuthInfo); |
Callback Function
1
|
virtual void OnLoginBySSOResult(hwmsdk::HwmErrCode ret, const char* reason, const HwmLoginResult* loginResult) {}; |
Parameter Description
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
code |
Yes |
char[] |
Authorization code |
domain |
Yes |
char[] |
Enterprise domain name |
authServerType |
Yes |
AuthServerType |
Authentication service type |
Parameter |
Description |
---|---|
AUTH_SERVER_TYPE_OAUTH2 |
SSO |
Return Values
Type |
Description |
---|---|
HwmErrCode |
If 0 is returned, the operation is successful. If other values are returned, the operation fails. For details about values returned upon failures, see Common Error Codes. |
HwmLoginResult |
Login result. For details, see Table 5. |
Sample Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
/** * Login */ int demoLoginBySSODlg::LoginBySSO() { int ret; //Enter login parameters. hwmsdkagent::HwmSSOAuthInfo ssoAuthInfo{}; strncpy_s(ssoAuthInfo.domain, GetDomain().c_str(), HWM_MAX_SSO_DOMAIN_LEN); strncpy_s(ssoAuthInfo.code, GetCode().c_str(), HWM_MAX_SSO_CODE_LEN); ssoAuthInfo.authServerType = hwmsdkagent::AUTH_SERVER_TYPE_OAUTH2; // Call the login API. ret = hwmsdkagent::LoginBySSO(&ssoAuthInfo); return ret; } |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot