Bug: Creating session with Session Error: 7

There are a few bugs in the current SDK that should be fixed. Without this fix, you end up with the Session Error: 7

  1. 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.

  2. 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"
}
1 Like

Hi @Johann, thanks for bringing this to our attention.

Please note that the code being used in the sample app is only for demonstrative purposes. We do not recommend generating your JWT on the client side as it may expose your developer credentials. The only truly secure way of transmitting your key/secret is to generate the JWT on your own servers.

Thanks!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.