Closed Atifmahmood12 closed 6 years ago
Looks like Base64.decode is the diff in the line new SecretKeySpec(**Base64.decode**(secret.getBytes()), "HmacSHA256");
.
Yes. That is the difference. secrete key decoding is also necessary here.
There is no need to decode the secret in these simple examples. We never expose or pass the secret so we don't need it in base64. I'm going to leave as is to keep it the same as all the other examples.
Your own implementation may vary but for these examples it is not needed.
Thanks for the feedback though. It is appreciated.
OK. You welcome.
https://github.com/jokecamp/jokecamp.com/commit/2d9f0734ae437b6d2d0603bc13c9f94435e1df89
Curernt example:
Correction in Example:
Note: Please correct it in the documentation.