Updated logic to do server side validation of the authentication