Discourse OneDrive Picker

Summary: This plugin helps users share files stored on OneDrive in Discourse posts.

:link: GitHub - Ahmedgagan/discourse-onedrive-picker:
:arrow_right: Install: Follow the plugin installation guide.

Configuration (Register An Azure App)

  • Visit Microsoft Azure

  • Click + New registration on the top left side of your screen.

  • Fill Name of your app.

  • Select Supported account types
    Here you will get 4 options, select according to your requirements:

    • Accounts in this organizational directory only (icm only - Single-tenant):
      This will only allow people of your organization to sign in to the one drive picker.

    • Accounts in any organizational directory (Any Azure AD directory - Multitenant):
      This will only allow people of any organization to sign in to the one drive picker. No personal account user will be able to sign in to one drive picker.

    • Accounts in any organizational directory (Any Azure AD directory - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox):
      This will allow people of any organization to sign in to the one drive picker. The personal account user will be able to sign in to one drive picker.

    • Personal Microsoft accounts only
      This will allow only personal accounts user to sign in to the one drive picker.

  • Scroll down, you will get an option to add Redirect URL :arrow_down:
    Here add your domain name/onedrive-picker . eg: https:meta.discourse.com/onedrive
  • Click Register, your app will be created.
  • Now Copy the Application Id for your application & paste it in discourse site setting, discourse_onedrive_azure_client_id
  • After this, go to the Authentication tab on the left navigation bar & check both these options.
    • Check Access tokens (used for implicit flows).
    • Check ID tokens (used for implicit and hybrid flows).
    • Click Save , on the left side.
  • Now, go to Certificates & secrets tab on the left navigation bar and create a New client secret.
  • Add Any description & select the expiry date & click Add.

You are done setting up one drive picker.

Usage Guide

  1. Press a cloud button in the Discourse composer to open OneDrive window.
  2. Select files or folders from OneDrive.
  3. Share links for anonymous view access are automatically generated.
  4. Links are inserted into the post body.

The administrator can choose whether links should be inserted raw (for one boxing) or in markdown format. One boxing doesn’t work for team SharePoint folders.

Site Settings

  • discourse_onedrive_picker_azure_client_id : Add Azure Application Client ID
  • discourse_onedrive_picker_use_markdown_url : Uses markdown format to insert link

Sponsor

@JonathanShaw

8 Likes

That’s a very cool #plugin! I would love to see a Google Drive version of this. :slight_smile:

When you select an image file from OneDrive to be pasted in the post, does it paste the actual source image link (thus, displaying the full image) or does it just paste a OneDrive link to the image file?

The same question also applies to videos.

1 Like

Thanks :blush:

It pastes onedrive link.

Oh, is there any way to change that?

1 Like

Its not possible at the moment, but I am open to contributions, if you can make a PR.

1 Like

@Ahmed_Gagan did great work making this for me. Do consider him if you need a Discourse developer.

3 Likes

Thanks a lot Jonathan :blush:

1 Like

Very interesting !!
@Ahmed_Gagan do you still maintain your plugin ?