Mbst 7141 authentication

*Unfinished* Also this work will be ported to the atlas project.