Fix for handling error response from authentication provider

Fix for #16