How do I configure Auth0 as a external identity provider for SharePoint online/Office 365 to edit word document

how do I configure Auth0 as a external identity provider for SharePoint online/Office 365 .

We need user to authenticate by Auth0 and then a rule in Auth0 to create a guest user in azure AD and authorise to edit document.

I could able to do SSO integration with o365

But can any one share me the rule 1 to create user in azure ad and rule2 to authorise with o365 as soon as user logged into application.