{"id":28436892,"url":"https://github.com/cern/msgraph-poll-discourse-plugin","last_synced_at":"2025-07-03T17:10:48.719Z","repository":{"id":168185434,"uuid":"643842833","full_name":"CERN/msgraph-poll-discourse-plugin","owner":"CERN","description":"Discourse plugin to enable polling emails usign Microsoft Graph API","archived":false,"fork":false,"pushed_at":"2023-11-10T15:21:14.000Z","size":18,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-05T23:07:56.193Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CERN.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-05-22T09:15:57.000Z","updated_at":"2023-05-23T07:48:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"50dce88a-3bf3-43be-bb72-1ba8e661e879","html_url":"https://github.com/CERN/msgraph-poll-discourse-plugin","commit_stats":null,"previous_names":["alessioc31/msgraph-poll-discourse-plugin"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/CERN/msgraph-poll-discourse-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CERN%2Fmsgraph-poll-discourse-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CERN%2Fmsgraph-poll-discourse-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CERN%2Fmsgraph-poll-discourse-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CERN%2Fmsgraph-poll-discourse-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CERN","download_url":"https://codeload.github.com/CERN/msgraph-poll-discourse-plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CERN%2Fmsgraph-poll-discourse-plugin/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262327277,"owners_count":23294243,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-05T23:07:53.557Z","updated_at":"2025-06-27T20:32:02.047Z","avatar_url":"https://github.com/CERN.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# msgraph-poll-discourse-plugin\nDiscourse plugin to enable polling emails usign Microsoft Graph API\n\n## Prerequisites\n\n- Have an application on your Azure Tenant with delegated permissions for `Mail.ReadWrite`.\n- Get a refresh token for the application with permissions to the mailbox used for the poll feature.\n\n## Get the refresh token\n\nThe easiest way to get a refresh token is to use the Device Code authorization flow (\u003chttps://learn.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-device-code\u003e).\n\n```bash\nTENANT_ID=\"\u003cTENANT_ID\u003e\"\nCLIENT_ID=\"\u003cCLIENT_ID\u003e\"\n\ncurl --request POST \\\n  --url https://login.microsoftonline.com/${TENANT_ID}/oauth2/v2.0/devicecode \\\n  --header 'Content-Type: application/x-www-form-urlencoded' \\\n  --data client_id=${CLIENT_ID} \\\n  --data 'scope=mail.readwrite offline_access'\n```\n\nThis request returns a JSON, from this we need the `user_code` and the `device_code`.\nOpen \u003chttps://microsoft.com/devicelogin\u003e and login with the mailbox you want to use for the poll feature, inserting the `user_code` when requested.\n\nAfter the login is successful:\n\n```bash\ncurl --request POST \\\n  --url https://login.microsoftonline.com/${TENANT_ID}/oauth2/v2.0/token \\\n  --header 'Content-Type: application/x-www-form-urlencoded' \\\n  --data grant_type=urn:ietf:params:oauth:grant-type:device_code \\\n  --data client_id=${CLIENT_ID} \\\n  --data device_code=\u003cdevice_code from the earlier JSON response\u003e\n```\n\nThis request returns a JSON with the `refresh_token`.\n\n## SiteSettings\n\nIt is possible to configure this plugin using the following SiteSettings:\n\n- `msgraph_polling_enabled`: `true` if the plugin is enabled\n- `msgraph_polling_mailbox`: the mailbox to use for the poll feature. It has to be the same you've used to retrieve when retrieving refresh token\n- `msgraph_polling_client_id`: the application id of the Azure application. It has to be the same to the one you've used when retrieving the refresh token\n- `msgraph_polling_tenant_id`: the tenant ID of your Azure tenant. It has to be the same to the one you've used when retrieving the refresh token\n- `msgraph_polling_oauth2_refresh_token`: the refresh token previously generated.\n\nThe polling period is the same to the pop3 polling feature present in Discourse core.\n\n## Install\n\nFollow the official guide from Discourse: \u003chttps://meta.discourse.org/t/install-plugins-in-discourse/19157\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcern%2Fmsgraph-poll-discourse-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcern%2Fmsgraph-poll-discourse-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcern%2Fmsgraph-poll-discourse-plugin/lists"}