improved HMAC Authentication with security Hooks