Like oil and water, Webhooks v2 and Webhooks v3 simply don’t mix: there are too many differences between the two to make for a seamless transition from version 2 to version 3 (i.e., you can’t just run an application and click Upgrade). Instead, migrating from v2 to v2 requires you to:
- Set up a new Webhooks v3 endpoint and a new database (or other container) for storing event notifications.
- Create new Webhooks v3 subscriptions.
- Begin event delivery, and verify that you can receive Webhooks v3 events.
- Turn off Webhooks v2, leaving you with two event databases: one for Webhooks v2, and a new one for Webhooks v3.
Why can’t you just point Webhooks v3 subscriptions to your existing v2 endpoint? There are several reasons for that, starting with this: the payloads used by the two Webhooks versions of are very different. For example, a Webhooks v2 notification looks something like this:
By comparison, a Webhooks v3 notification, which is encoded and formatted as a security event token, looks like this when sent to a webhooks endpoint:
And, even when decoded, the payload looks like this:
"iss": "Akamai Identity Cloud",
Obviously major changes must be made to your endpoint to enable it to receive and process the v3 event notifications; you’ll also need to set up a process for decoding the payloads and (ideally) for validating the security event token signatures.
On top of that, you’ll need to create a new database (assuming you store the received notifications in a database) to accept the new fields and the new schema used by Webhooks v3. Yes, in theory you might be able to modify your existing v2 database to store v3 events. But to make that database usable, you’ll also have to make changes to all your v2 events. That’s because field names and field values differ between Webhooks versions 2 and 3. For example, when it comes to date and timestamps, Webhooks v2 uses a field named datetime and the ISO 8061 datetime format:
Meanwhile, Webhooks v3 uses a field named iat and the Unix Epoch datetime format:
Perhaps even more important, Webhooks v3 stamps each notification with a unique identifier (jti) that makes it easy to search for a specific event. Webhooks v2 notifications have no such identifier.
The bottom line? Migrating from Webhooks v2 and v3 will require some thought and effort on your part. For more information, and for a little advice, contact your Identity Cloud representative.