There are a few bugs in the current SDK that should be fixed. Without this fix, you end up with the Session Error: 7
-
Liine 58 in JWTUtil.java shows the following:
payLoadObject.put("typ", "JWT");
This is incorrect. It should be:
headerObject.put("typ", "JWT");
If no JWT token is provided, it will get generated by this code and it will be incorrect. The typ field must appear in the header.
-
The tpc field is missing in the code. It is required:
payLoadObject.put("tpc", "test");
Keep in mind that the value for tpc in the demo app is provided by the user entering in the session name (which corresponds to the tpc field), so the code needs to add it from the text input field.
I had trouble still getting it to work until I realized that the user_identity field in the JWT token had to match up exactly as what the user inputs in the input field on the Create Session screen. Once I did that, it worked. So the following JWT is one that works:
"app_key": "xxx",
"version": 1,
"user_identity": "Johann",
"iat": 1613902856,
"exp": 1613989256,
"tpc": "test"
}