Allow the rest auth method to return a custom response. Closes #1460