← Push Notifications / Authenticating Push Notifications with JWT
SIGNiX can secure push notifications with a JSON Web Token (JWT). When JWT is turned on, each push carries a signed token. Your server verifies the token to confirm the push came from SIGNiX. JWT is an alternative to the current push authentication. Added in SIGNiX Release 185.
Content-Type: application/json.Authorization header. Do not expect Bearer before it. The header holds the token alone.OK. Any other status is a failed push and is retried. See Retries.TransactionClientNotifyURL overrides the URL set for your client, as with any push. If your account is configured for JWT, the push to that URL is also sent as a JWT-secured POST.jti and iat.Tokens are signed with RS256 (RFC 7519 and RFC 7518). The token header looks like this:
{"alg":"RS256","typ":"JWT","kid":"<key name>"}The claims are:
| Claim | Value |
|---|---|
iss | SIGNiX (configurable) |
sub | Your client ID (configurable) |
aud | Your client ID (same as sub) |
jti | A random UUID, new for every token |
iat | Time issued, in seconds since the epoch |
exp | Time the token expires, in seconds since the epoch. The lifetime is currently 5 minutes and is configurable. |
No other claims are sent with push notifications. SIGNiX Operations recommends standard values for iss, sub and aud. You can ask for different values.
kid value based on what your integration needs. It is the external name for the key.alg to be RS256. Never use the algorithm the token names to decide how to verify it.kid to find your public key.<header>.<claims> text, exactly as received. Do not parse and re-serialize it first.exp, iss and aud, allowing a small clock skew.The signature covers only the header and claims. It does not cover the URL, query string or body. A valid token shows the push came from SIGNiX, but it does not prove the body was unaltered. Don't rely on the token for body integrity.
If you want replay protection, track an identifier from the message body, such as the transaction ID, combined with the event type. Do not use jti for this, because a retry never reuses a token. You can still use jti to reject a repeated copy of the same token, but that is rare.
If your server responds with anything other than HTTP 200, the push fails and is rescheduled. The NotifyClientResendSchedule client preference controls the number of retries and how often they happen. It is currently set to retry 3 times, every 5 minutes, for all clients. Other settings have not been tested. SIGNiX does not look at the response beyond the status code. See Notification Failure & Retries for how failed pushes are queued.
Every attempt gets a fresh token, with a new iat, exp and jti. This includes a retry after your server rejected an expired token.
alg instead of requiring RS256.exp as a date string. It is seconds since the epoch.jti to detect duplicate events. Each retry has a new jti.Authorization header read without Bearer.kid.exp, iss and aud checked.1110 Market Street, Suite 402
Chattanooga, TN 37402
877.890.5350
info@SIGNiX.com
©2016 SIGNiX. All Rights Reserved.