Clould API / JWT / .Net

The Token API is rejecting my POST to get the Poynt access token. I am POSTing the code I received from a merchant grant to get the Poynt token and I am getting a JWT claims error. I have confirmed my self signed JWT is signed correctly using my PEM data on https://jwt.io/ and comparing the encoded results. Below is a URL that has all of the data I am sending to Poynt.

https://requestb.in/1c7gmi41?inspect

If anyone has any examples of doing this in .Net that would be great.

Below is the the response body I am getting:

{“code”:“INVALID_ACCESS_TOKEN”,“httpStatus”:401,“message”:“Access token is missing or invalid.”,“developerMessage”:“Failed to get JWT claims set.”,“requestId”:“355d6214-949e-4f17-a57c-8678bfdfbecf”}

Hi Martin, would you mind sending me a sample self-signed JWT generated by your code so I can compare and see what’s going on ? Please send it to my email praveen_at_poynt_co. Thanks.

I figured out my issue. I had two problems.

  1. I needed to force TLS 1.2 for my HTTP communication; ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

  2. Claims “exp” and “iat” values need to be numerical. The encoding was putting quotes around their values until I explicitly said they were integer types.

1 Like