From sgcWebSockets 2022.5.0 there is a new class that simplifies the process of authenticate an user using the Microsft Azure Account as Authentication. The class let you login with your Microsoft Account in an easy way.
Configuration
The module requires first configure your OAuth2 Application in your Microsoft Account, once are configure just add a couple of lines in your application to allow users login with any Microsoft Account.
The Local Server used to read the response from Google, by default listens on IP Address 127.0.0.1 and port 8080 and SSL enabled. So you must configure the CallBack URL https://localhost:8080 (Microsoft only allows localhost for local URLs) in the Microsoft Application. Of course, you can modify the IP Address and port.
Once configured the OAuth2 Application in the Microsoft Account, just create an instance of TsgcHTTP_OAuth2_Client_Microsoft and call the method Authenticate passing as parameters the TenantId, Client_Id and Client_Secret. This method waits (by default up to 60 seconds) till the user has login successfully. Returns an object where you can check if the user has authenticated or not, the Name, Id... and more data from the user profile.