Authentication implementation. Functioning