The documentation is not wrong here. The back-end implementation does in fact match against a route that includes the camel-case version of 'orgUnits'. I can speculate on what's going on here:
- The back-end service's route loader (the thing that matches the URL path against a controlling handler for the API call) may be case-insensitive when it's doing route matching, so that if your API call passes the auth check, then 'orgunits' and 'orgUnits' will both serve to match the route to the right handler.
- The auth signatures however, are almost certainly NOT case sensitive; additionally, (and because of this), I believe it's a requirement that the path-component that forms the middle part of the base-string is lower-cased before signature generation, so that both clients and back-end service can always assume that the lower-case form of the URL will be uniformly used to generate auth tokens.
- This means that, if you're not using one of our auth client libraries, the signature-generation code you write should lower-case the path component when forming the base string. Here's the Python code for example:
def _build_tokens_for_path(self, path, method='GET'):
if self.invalid_path_chars.search(path):
raise ValueError("path contains invalid characters for URL path")
time = self._get_time_string()
bs_path = urllib.parse.unquote_plus(path.lower())
base = '{0}&{1}&{2}'.format(method.upper(), bs_path, time)
app_sig = self.signer.get_hash(self.app_key, base)
if self.anonymous:
user_sig = ''
else:
user_sig = self.signer.get_hash(self.user_key, base)
# return dictionary containing the auth token parameters
return {self.APP_ID: [self.app_id],
self.APP_SIG: [app_sig],
self.USER_ID: [self.user_id],
self.USER_SIG: [user_sig],
self.TIME: [time]}
It wasn't just that route that wouldn't work for you: any route that had upper-case characters in it will exhibit this problem if you don't lower-case your path when forming the base-string for signature generation.
I will make sure that the docs around authentication point out the necessity of this: I'm not sure the docs don't already do this, but admittedly, the ID Key Authentication topic in the docs is very technical and very dense.
--
Viktor