Tyk Cloud: Key object validation failed

Imported Google Group message. Original thread at: Redirecting to Google Groups Import Date: 2016-01-19 21:39:14 +0000.
Sender:Patrick Plaatje.
Date:Sunday, 3 January 2016 16:41:58 UTC.

Hi,

Martin already helped me out tremendously on this issue before, but I still cannot seem to get JWT validation to work on Tyk Cloud. I am now trying to validate the generated key on the Tyk Cloud Admin Dashboard to see if anything is wrong with the key. When I try to update the key in the dashboard however, an error shows up, saying: Key object validation failed. Does anyone know why this happens?

Thanks!
Patrick

Imported Google Group message.
Sender:Martin Buhr.
Date:Sunday, 3 January 2016 18:18:45 UTC.

Hi Patrick,

Yup, it just needs to be an empty object ({}), instead of null, which can happen sometimes.

Cheers,
Martin

  • show quoted text -

  • show quoted text -

To view this discussion on the web, visit https://groups.google.com/d/msgid/tyk-community-support/0b296eaf-8ff8-4538-8ecc-686e0c650953%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Imported Google Group message.
Sender:Patrick Plaatje.
Date:Sunday, 3 January 2016 16:57:48 UTC.

Hi Patrick,

That error means that there’s something wrong with the key itself. Did you create it using the dashboard or the API?

It could be some missing metadata on the key, when users create them with the API and don’t include an empty metadata object it won’t validate properly in the dashboard on update.

Top tip: add some meta data and tags to the key then update.

If that fails, check the console, the response from the API will have a long JSON error object showing which fields aren’t validating.

Btw - I know you are using HMAC for JWTs, but remember Tyk has two HMAC fields for a Tyk key, one for JWTs and one specifically for HMAC signed requests, they are different auth methods so need to be treated differently if creating a key ID with the REST API.

Cheers,
Martin

  • show quoted text -

  • show quoted text -


You received this message because you are subscribed to the Google Groups “Tyk Community Support” group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web, visit https://groups.google.com/d/msgid/tyk-community-support/7a1f7244-b856-4fe7-a6f8-64734fca53a2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Imported Google Group message.
Sender:Martin Buhr.
Date:Sunday, 3 January 2016 17:18:41 UTC.

Hi Martin,

It is indeed the meta-data which was the culprit here. I added some test data, and it updated correctly. I created the key through the API, as for my use-case it needs to be an automated process. The JWT/HMAC part is fine (I think), the request that generates the keys is:

{“last_check”:0,“allowance”:0,“rate”:1000,“per”:60,“expires”:1451842456,“quota_max”:-1,“quota_renews”:0,“quota_remaining”:0,“quota_renewal_rate”:0,“access_rights”:{“xxxxx”:{“api_id”:“xxxxx”,“api_name”:“xxxx”,“versions”:[“Default”]}},“jwt_data”:{“secret”:“secret-passphrase”}}

I assume I should be adding “meta_data”:{“test”:“test”} (or something similar).

Thanks!

  • show quoted text -

Imported Google Group message.
Sender:Patrick Plaatje.
Date:Sunday, 3 January 2016 18:18:45 UTC.

Hi Patrick,

Yup, it just needs to be an empty object ({}), instead of null, which can happen sometimes.

Cheers,
Martin

  • show quoted text -

  • show quoted text -

To view this discussion on the web, visit https://groups.google.com/d/msgid/tyk-community-support/0b296eaf-8ff8-4538-8ecc-686e0c650953%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.