hwdsb / onedrive

A WordPress plugin to embed OneDrive items using the OneDrive block or [onedrive] shortcode.
0 stars 0 forks source link

Multisite: File Picker will not open if used on a subdomain #2

Closed r-a-y closed 3 years ago

r-a-y commented 3 years ago

It appears that the File Picker SDK will check the current URL against the registered URL for the picker.

If there is a domain mismatch the File Picker will fail to open. The problem here is we will need to get this working with WP multisite subdomain setups (like ours). And it doesn't make sense to add all of our subdomains to our Azure app. Mapped domains will also be a problem.

Will see if I can workaround this.

See:

r-a-y commented 3 years ago

I've got this working locally.

If there is a domain mismatch, we will use an <iframe> for the picker and pass back the OneDrive File Picker values with postmessage to our block (basically followed the advice of the second point above). If the domain matches, we will stick with the easier <button> routine.