api auth fix for basic and jwt

makes sure we encrypt the jwt token using the correct secret
(from apiKey.properties) and make sure to check the secret key
for basic auth as well.
Basic auth is using the combo of id:secret base64 encoded which is sent over the wire to the users api. We need to check that the api key is valid, and that means checking both key and secret and validity. I can change this so that we fetch the key only based on id (which is unique anyway) and then check the secret locally.