{"id":13725897,"url":"https://github.com/mattermost/mattermost-browser-extension","last_synced_at":"2025-05-07T21:30:39.916Z","repository":{"id":55782256,"uuid":"142596810","full_name":"mattermost/mattermost-browser-extension","owner":"mattermost","description":"Demo Chrome extension for Mattermost 5.2+","archived":false,"fork":false,"pushed_at":"2022-11-14T18:08:52.000Z","size":234,"stargazers_count":16,"open_issues_count":0,"forks_count":12,"subscribers_count":31,"default_branch":"master","last_synced_at":"2025-03-26T14:56:12.556Z","etag":null,"topics":["hacktoberfest"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mattermost.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}},"created_at":"2018-07-27T15:52:36.000Z","updated_at":"2023-04-12T04:07:08.000Z","dependencies_parsed_at":"2023-01-22T06:46:09.870Z","dependency_job_id":null,"html_url":"https://github.com/mattermost/mattermost-browser-extension","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattermost%2Fmattermost-browser-extension","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattermost%2Fmattermost-browser-extension/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattermost%2Fmattermost-browser-extension/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattermost%2Fmattermost-browser-extension/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mattermost","download_url":"https://codeload.github.com/mattermost/mattermost-browser-extension/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252957047,"owners_count":21831424,"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":["hacktoberfest"],"created_at":"2024-08-03T01:02:39.955Z","updated_at":"2025-05-07T21:30:39.640Z","avatar_url":"https://github.com/mattermost.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mattermost Demo Browser Extension\n\nThis project demonstrates how to write a Browser extension that uses OAuth 2.0 to connect to a Mattermost user's account.\n\n## Prerequisites\n\n- Mattermost 5.2+\n- [npm 4.3+](https://www.npmjs.com/)\n\n## Set up and Demo\n\n1. Clone this repository and `cd` into it:\n\n   ```bash\n   $ git clone https://github.com/mattermost/mattermost-browser-extension\n   $ cd mattermost-browser-extension\n   ```\n\n2. Create an OAuth 2.0 app on your Mattermost instance [with these instructions](https://docs.mattermost.com/developer/oauth-2-0-applications.html)\n\n   - Make sure to copy the Client ID after the app is created\n   - Callback URL is `https://example-extension-id.chromiumapp.org/`, need to modify this later\n   - Optionally, you can mark the app as trusted so users do not need to click \"Allow\" for the app when they log in\n\n3. Configure the extension by modifying the constants in `src/app/views/App.js`:\n\n   - Set `MATTERMOST_URL` to the URL for your Mattermost instance\n   - Set `OAUTH_APP_CLIENT_ID` to the Client ID you copied last step\n   - Optionally, set `LOGIN_HINT` to `saml` if your Mattermost users login using a SAML IDP. This will skip the Mattermost login page and go directly to the SAML IDP's login\n\n4. Install dependencies and build the extension:\n\n   ```bash\n   # npm\n   $ npm install\n   $ npm run build\n\n   # yarn\n   $ yarn install\n   $ yarn build\n   ```\n\n5. Add the extension to your Browser:\n\n   - Chrome:\n     - Go to `chrome://extensions/` in your Chrome browser\n     - Click \"Load unpacked\" and navigate to and select your `mattermost-browser-extension` directory\n   - Firefox:\n     - Go to `about:debugging` in your Firefox browser\n     - Click \"Load temporary add-on\" and navigate to and select any file in `mattermost-browser-extension` directory\n\n6. Allow cross-origin requests from your browser extension to Mattermost:\n\n   - Set `ServiceSettings.AllowCorsFrom` in your `config.json` to `*`\n   - Restart your Mattermost server\n   - Modify OAuth 2.0 app Callback URL in step 2, e.g. `https://ajfkdfomehaklgdhggbfhhicchlangjp.chromiumapp.org/`, `ajfkdfomehaklgdhggbfhhicchlangjp` is your extension id. For Firefox there are in the form `https://\u003cEXTENSION_ID\u003e.extensions.allizom.org/` but not displayed anywhere in the browser. You should get it by printing browser.identity.getRedirectURL() result in the extension\n\n7. Use the extension\n   - In the browser toolbar a Mattermost logo should have been added, click on it\n   - Click the \"Click here to connect to Mattermost.\" button\n   - Complete the login process and click \"Allow\" if prompted\n   - Click on the Mattermost logo in the toolbar again, you should now see some of the user's information displayed\n\n## The Code\n\nThis extension uses [React](https://reactjs.org/), though it is not a requirement for your extension.\n\nThe important demo code lives in `src/app/views/App.js`. Read the code and comments in there to get a better understanding of how it works.\n\nMake sure your extension follows the [OAuth 2.0 RFC](https://tools.ietf.org/html/rfc6749) for clients. The implicit grant flow is used.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattermost%2Fmattermost-browser-extension","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattermost%2Fmattermost-browser-extension","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattermost%2Fmattermost-browser-extension/lists"}