Hi,
I created simple auth. to server but didn’t get onAuthenticationReturn.
Code example:
#include "stdafx.h"
#include "sdk_util.h"
#include <conio.h>
using namespace DuiLib;
class ZoomAuthService : public ZOOM_SDK_NAMESPACE::IAuthServiceEvent
{
public:
ZoomAuthService() {}
virtual ~ZoomAuthService() {}
ZOOM_SDK_NAMESPACE::IAuthService* ZoomAuthService::GetAuthService() {
if (m_pAuthService == nullptr) {
ZOOM_SDK_NAMESPACE::CreateAuthService(&m_pAuthService);
if (m_pAuthService)
{
m_pAuthService->SetEvent(this);
}
}
return m_pAuthService;
}
virtual void onAuthenticationReturn(ZOOM_SDK_NAMESPACE::AuthResult ret) {
printf("onAuthenticationReturn\n");
}
virtual void onLoginRet(ZOOM_SDK_NAMESPACE::LOGINSTATUS ret, ZOOM_SDK_NAMESPACE::IAccountInfo* pAccountInfo) {
printf("onLoginRet\n");
}
virtual void onLoginReturnWithReason(ZOOM_SDK_NAMESPACE::LOGINSTATUS ret, ZOOM_SDK_NAMESPACE::IAccountInfo* pAccountInfo, ZOOM_SDK_NAMESPACE::LoginFailReason reason) {
printf("onLoginReturnWithReason\n");
}
virtual void onLogout() {
printf("onLogout\n");
}
virtual void onZoomIdentityExpired() {
printf("onZoomIdentityExpired\n");
}
virtual void onZoomAuthIdentityExpired() {
printf("onZoomAuthIdentityExpired\n");
}
private:
ZOOM_SDK_NAMESPACE::IAuthService* m_pAuthService = nullptr;
};
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR /*lpCmdLine*/, int nCmdShow)
{
AllocConsole();
freopen("CONOUT$", "w", stdout);
printf("Starting app\n");
ZOOM_SDK_NAMESPACE::InitParam initParam;
initParam.strWebDomain = L"https://zoom.us";
initParam.enableLogByDefault = true;
initParam.enableGenerateDump = true;
auto err = ZOOM_SDK_NAMESPACE::InitSDK(initParam);
if (ZOOM_SDK_NAMESPACE::SDKERR_SUCCESS != err) {
printf("failed InitSDK\n");
return -1;
}
ZoomAuthService server;
auto authServer = server.GetAuthService();
if (!authServer) {
printf("failed GetAuthService\n");
return -1;
}
ZOOM_SDK_NAMESPACE::AuthContext authParam;
authParam.jwt_token = L"MY_TOKEN";
err = authServer->SDKAuth(authParam);
if(ZOOM_SDK_NAMESPACE::SDKERR_SUCCESS != err) {
printf("failed SDKAuth\n");
return -1;
}
printf("Waiting ...\n");
getch();
printf("Finished app\n");
return 0;
}