Implement user authrorization process; add unit&integration tests