In order to get SharePoint integration to work, an application must be registered in Office 365

The system can only use certificate for authentication.
Create a self-signed certificate with PowerShell on the server.
Upload the certificate to the application in Office 365 Admin center.
Make sure the app permissions is set with the following access
