a method to authenticate via hmac