Meeting SDK Type and Version
Meeting SDK Windows + C# Wrapper 5.14.5.15340
Description
Hi, I have some trouble to authenticate with the Windows Meeting SDK (C# Wrapper).
I have 2 main issues:
-
Sometime, the CZoomSDKeDotNetWrap.Instance.GetAuthServiceWrap().Add_CB_onAuthenticationReturn callback is not actually called and I have no idea why. I activated the log and there is nothing in it.
-
When the callback work, I always receive an error code 11 who is not documented and not part of the enum AuthResult.
Here is the code:
private void ButtonAuth_Click( object sender, RoutedEventArgs e )
{
//register callback
CZoomSDKeDotNetWrap.Instance.GetAuthServiceWrap().Add_CB_onAuthenticationReturn( OnAuthenticationReturn );
CZoomSDKeDotNetWrap.Instance.GetAuthServiceWrap().Add_CB_onLoginRet( OnLoginRet );
CZoomSDKeDotNetWrap.Instance.GetAuthServiceWrap().Add_CB_onLogout( OnLogout );
AuthContext authContext = new AuthContext { jwt_token = GenerateJwtToken() };
CZoomSDKeDotNetWrap.Instance.GetAuthServiceWrap().SDKAuth( authContext );
Hide();
}
private static string GenerateJwtToken()
{
long iat = (int)( DateTime.Now - new DateTime( 1970, 1, 1 ) ).TotalSeconds;
long exp = iat + 60 * 60 * 24; // 24 hours
long tokenExp = exp;
string payload = JsonSerializer.Serialize(
new
{
appKey = "OAuth Server to Server App Client ID",
iat,
exp,
tokenExp
} );
string token = JWT.Encode(
$"{payload}",
Encoding.ASCII.GetBytes( "OAuth Server to Server App Client Secret" ),
JwsAlgorithm.HS256 );
return token;
}