What is the recommended way to handle authentication failure in Silhouette

If authenticate method of CredentialsProvider fails then it throws InvalidPasswordException. This makes my server application send 500 response. I will prefer to send a custom JSON instead. What is the recommended way to do this?


If you do not catch the exception, then Play will handle it for you with the Play error handler. In your case you should catch the exception and return the appropriate result.

Best regards,