Hello everyone,
does anybody know how to use Consumer Keys and Consumer Secrets including special characters?
The thins is, we were using Apigee 4.17.05 and we had registrered some Consumer Keys like this
{ consumerKey: 'someText.test', consumerSecret: 'the_secret' }
And it worked perfectly. Sadly after upgrading to 4.17.09 this is no longer possible.
According to the documentation, the pattern used is still the same, but while creating the consumerKey using the REST Api we get the following error:
statusCode: 400 { "code" : "keymanagement.service.ConsumerKeyHasInvalidCharacters", "message" : "Consumer key has invalid characters and does not match specifications. Use this regex [A-Za-z0-9\\-_]+ to check validity.", "contexts" : [ ] }
Does anybody know how to change this pattern, in order to use consumerKeys that include "."?
Thanks in advance,
Oscar
PS: As attachment I sended the old working configuration on Apigee 4.17.05.01consumerkey.png
Solved! Go to Solution.
Sadly, no one knows how to change the pattern, because it's not possible to change the pattern.
You could introduce a substitution at runtime, to work around the restriction.
When importing, do a string substitution to replace... for example.... dot with dash.
And then when validating, do the same.
Sadly, no one knows how to change the pattern, because it's not possible to change the pattern.
You could introduce a substitution at runtime, to work around the restriction.
When importing, do a string substitution to replace... for example.... dot with dash.
And then when validating, do the same.
Thanks for your help.
We decided to update the Node.JS REST Calls using
String.prototype.replaceAll = function (find, replace) { var str = this; return str.replace(new RegExp(find, 'g'), replace); }; routeProduct.replaceAll("[^A-Za-z0-9\\-_]", "");
and the same during the policy validation.
Have a nice day
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |