Relates to OPENAM-16451 - Problem with HMAC secret when upgrading from AM 5.5
The issue is not at the time of signing but at the time of saving a new HMAC secret in the console:
The issue with the UI in AM 5.5, and AM 6.0 console, is that when the HMAC secret is put in, there is no validation to warn that the size is smaller than the required 256 bits. It allows you to put a secret that cannot work. If the secret is too short and you try to sign a token with it, it will fail.
NOTE: If you are already signing tokens with HMAC in AM 5.5 and 6.0 the upgrade route is going to work.
This problem does not happen in AM 6.5 because the secret is not captured in the AM console.
This can be reproduced
- Deploy AM 5.5.1
- All default configuration
- Configure > Global Services > OAuth2Provider > Advanced
- Add your own string for an Hmac signature secret
- Create an OAuth2 service under the root realm (or in a new realm) - you may also change the secret the current realm at this point for - same result will happen.
- Save the OAuth2 service making sure that the HMAC secret is selected to do token signature (default)
- Start upgrade:
- kill tomcat
- replace war file
- upgrade fails at the OAuth2Secret
NOTE: This problem occurs if the secret selected is too short - secrets with a long enough size (e.g. 32 characters) are upgraded...