Answer:
HMAC is a Hash Function which uses both the message and the secret key as the input.The key which is there is split into two parts mainly the inner key and the outer key the inner key is used along with the message to compute the internal hash value,after computing internal hash value it is again used along with the external key to compute the final hash value.
1)Since the message is hashed any change in the message causes a change in the hash value thus the data integrity is verified.
2)Authenticity of the message is ensured as the secret key is used to find out the hash value along with the message and thus at the receiving side the hash is recomputed and if it does not match then the authenticity of the message is lost basically the secret key is used to verify the authenticity.