Login employee by using Microsoft accounts O365

I want to create a module that enables me to log in with Microsoft account how can I do that? I need a guide for this topic