Added encoding and exception handling for AuthNResponse.

Added encoding and exception handling for AuthNResponse.