{"id":16294911,"url":"https://github.com/jan-molak/authenticator-browser-extension","last_synced_at":"2025-05-11T04:27:14.918Z","repository":{"id":34302453,"uuid":"176263512","full_name":"jan-molak/authenticator-browser-extension","owner":"jan-molak","description":"Enables your browser-based automated tests to authenticate with your web app.","archived":false,"fork":false,"pushed_at":"2025-03-17T18:55:02.000Z","size":2534,"stargazers_count":14,"open_issues_count":37,"forks_count":10,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-12T06:46:46.688Z","etag":null,"topics":["chrome-extension","e2e","protractor","serenity-js","testing-tools","typescript","wdio","webdriver"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"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/jan-molak.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["jan-molak"],"tidelift":"npm/authenticator-browser-extension"}},"created_at":"2019-03-18T10:54:23.000Z","updated_at":"2025-03-24T05:51:51.000Z","dependencies_parsed_at":"2023-02-15T04:31:37.125Z","dependency_job_id":"95fc78ed-5292-41ee-a556-cc9927e12d4f","html_url":"https://github.com/jan-molak/authenticator-browser-extension","commit_stats":{"total_commits":168,"total_committers":10,"mean_commits":16.8,"dds":0.6726190476190477,"last_synced_commit":"4192a38865fb0584d29b3ba6704fa4b092ae3334"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jan-molak%2Fauthenticator-browser-extension","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jan-molak%2Fauthenticator-browser-extension/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jan-molak%2Fauthenticator-browser-extension/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jan-molak%2Fauthenticator-browser-extension/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jan-molak","download_url":"https://codeload.github.com/jan-molak/authenticator-browser-extension/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253518956,"owners_count":21921074,"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":["chrome-extension","e2e","protractor","serenity-js","testing-tools","typescript","wdio","webdriver"],"created_at":"2024-10-10T20:16:52.760Z","updated_at":"2025-05-11T04:27:14.883Z","avatar_url":"https://github.com/jan-molak.png","language":"TypeScript","funding_links":["https://github.com/sponsors/jan-molak","https://tidelift.com/funding/github/npm/authenticator-browser-extension","https://tidelift.com/subscription/pkg/npm-authenticator-browser-extension?utm_source=npm-authenticator-browser-extension\u0026utm_medium=referral\u0026utm_campaign=enterprise\u0026utm_term=repo"],"categories":[],"sub_categories":[],"readme":"# Authenticator (Browser Extension)\n\n[![npm version](https://badge.fury.io/js/authenticator-browser-extension.svg)](https://badge.fury.io/js/authenticator-browser-extension)\n[![Build Status](https://github.com/jan-molak/authenticator-browser-extension/workflows/build/badge.svg)](https://github.com/jan-molak/authenticator-browser-extension/actions)\n[![Coverage Status](https://coveralls.io/repos/github/jan-molak/authenticator-browser-extension/badge.svg)](https://coveralls.io/github/jan-molak/authenticator-browser-extension)\n[![npm](https://img.shields.io/npm/dm/authenticator-browser-extension.svg)](https://npm-stat.com/charts.html?package=authenticator-browser-extension)\n[![Known Vulnerabilities](https://snyk.io/test/github/jan-molak/authenticator-browser-extension/badge.svg)](https://snyk.io/test/github/jan-molak/authenticator-browser-extension)\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fjan-molak%2Fauthenticator-browser-extension.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fjan-molak%2Fauthenticator-browser-extension?ref=badge_shield)\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n\n[![Twitter Follow](https://img.shields.io/twitter/follow/JanMolak?style=social)](https://twitter.com/JanMolak)\n\nAuthenticator is a [web browser extension](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions)\nthat enables your automated tests to authenticate with web apps using [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication).\n\nAuthenticator generates the browser extension dynamically, so you can easily provide the username and password\nvia a config file or env variables.\n\nAuthenticator is [proven to work](https://github.com/jan-molak/authenticator-browser-extension/tree/master/e2e) with following test frameworks:\n- [WebdriverIO](https://webdriver.io/) ([example](https://github.com/jan-molak/authenticator-browser-extension/tree/master/e2e/webdriverio))\n- [Protractor](https://www.protractortest.org/#/) ([example](https://github.com/jan-molak/authenticator-browser-extension/tree/master/e2e/protractor))\n- [Puppeteer](https://github.com/puppeteer/puppeteer) ([example](https://github.com/jan-molak/authenticator-browser-extension/tree/master/e2e/puppeteer))\n\nand following browsers:\n- [Google Chrome](https://www.google.co.uk/chrome/) ([example 1](https://github.com/jan-molak/authenticator-browser-extension/tree/master/e2e/protractor), [example 2](https://github.com/jan-molak/authenticator-browser-extension/tree/master/e2e/webdriverio))\n- [Firefox Developer Edition](https://www.mozilla.org/en-GB/firefox/developer/) ([example](https://github.com/jan-molak/authenticator-browser-extension/tree/master/e2e/webdriverio))\n\nIt's possible that Authenticator will work with other browsers supporting [Web Extensions](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions) and [`webRequest.onAuthRequired`](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/webRequest/onAuthRequired) API. However, I didn't have a chance to verify it yet. \n\n## For Enterprise\n\n\u003ca href=\"https://tidelift.com/subscription/pkg/npm-authenticator-browser-extension?utm_source=npm-authenticator-browser-extension\u0026utm_medium=referral\u0026utm_campaign=enterprise\u0026utm_term=repo\" target=\"_blank\"\u003e\u003cimg width=\"163\" height=\"24\" src=\"https://cdn2.hubspot.net/hubfs/4008838/website/logos/logos_for_download/Tidelift_primary-logo.png\" class=\"tidelift-logo\" /\u003e\u003c/a\u003e\n\nAuthenticator is available as part of the [Tidelift Subscription](https://tidelift.com/subscription/pkg/npm-authenticator-browser-extension?utm_source=npm-authenticator-browser-extension\u0026utm_medium=referral\u0026utm_campaign=enterprise\u0026utm_term=repo). The maintainers of Authenticator and thousands of other packages are working with Tidelift to deliver one enterprise subscription that covers all of the open source you use. If you want the flexibility of open source and the confidence of commercial-grade software, this is for you. [Learn more.](https://tidelift.com/subscription/pkg/npm-authenticator-browser-extension?utm_source=npm-authenticator-browser-extension\u0026utm_medium=referral\u0026utm_campaign=enterprise\u0026utm_term=repo)\n\n## Usage\n\nInstall the module from npm:\n\n```\nnpm install --save-dev authenticator-browser-extension\n```\n\nThe best place to look for usage examples is the [e2e test suite](https://github.com/jan-molak/authenticator-browser-extension/tree/master/e2e).\n\n### WebdriverIO\n\nImport the `authenticator-browser-extension` in the [`wdio.conf.js`](https://webdriver.io/docs/options.html) file and add `Authenticator` to the list of Chrome extensions:\n\n```javascript\n// wdio.conf.js\n\nconst { Authenticator } = require('authenticator-browser-extension');\n\nexports.config = {\n    \n    capabilities: [{\n        browserName: 'chrome',\n\n        'goog:chromeOptions': {\n            extensions: [\n                Authenticator.for('username', 'password').asBase64()\n            ]\n        }\n    }],\n    \n    // other WebdriverIO config\n}\n```\n\n### Protractor\n\nImport the `authenticator-browser-extension` in the [`protractor.conf.js`](https://www.protractortest.org/#/api-overview#example-config-file) file and add `Authenticator` to the list of Chrome extensions:\n\n```javascript\n// protractor.conf.js\n\nconst { Authenticator } = require('authenticator-browser-extension');\n\nexports.config = {\n\n    capabilities: {\n        browserName: 'chrome',\n\n        chromeOptions: {\n            extensions: [\n                Authenticator.for('username', 'password').asBase64()\n            ]\n        }\n    },\n\n    // other Protractor config\n}\n```\n\n### Puppeteer\n\nImport the `authenticator-browser-extension` and generate an expanded `Authenticator` web extension directory before launching a Puppeteer browser:\n\n```typescript\n// puppeteer/chrome-authenticator-extension.spec.ts\nconst { Authenticator } = require('authenticator-browser-extension');\n \nconst authenticator = Authenticator.for('admin', 'Password123')\n    .asDirectoryAt(`${process.cwd()}/build/puppeteer/authenticator`);\n\nbrowser = await puppeteer.launch({\n    headless: false,\n\n    args: [\n        `--disable-extensions-except=${authenticator}`,\n        `--load-extension=${authenticator}`,\n        `--no-sandbox`,\n    ],\n});\n```\n\n### Playwright\n\nRequires launching a [persistent browser context instance](https://playwright.dev/docs/api/class-browsertype?_highlight=persistent#browsertypelaunchpersistentcontextuserdatadir-options) containing the `Authenticator` extension. In every other way a carbon copy of the Puppeteer prototype.  \n\n```typescript\n// playwright/chrome-authenticator-extension.spec.ts\nconst extensionDirectory = `${process.cwd()}/build/playwright/authenticator`;\n\nconst authenticator = Authenticator.for(\n    'admin',\n    'Password123'\n).asDirectoryAt(extensionDirectory);\n\nbrowser = await playwright['chromium'].launchPersistentContext(\n    extensionDirectory,\n    {\n        args: [\n            `--disable-extensions-except=${authenticator}`,\n            `--load-extension=${authenticator}`,\n            `--no-sandbox`,\n        ],\n        headless: false,\n    }\n);\n```\n\n## Known limitations\n\n### Chrome headless\n\nChrome doesn't support browser extensions when running in [headless mode](https://developers.google.com/web/updates/2017/04/headless-chrome) and Chrome developers have [decided against](https://bugs.chromium.org/p/chromium/issues/detail?id=706008#c5) implementing this feature in any near future due to complexity of the task.\n\nThe best way to get around this limitation is to use Chrome together with\nthe [X Virtual Framebuffer (XVFB)](https://en.wikipedia.org/wiki/Xvfb).\n\n### Firefox\n\nAuthenticator generates the web extension dynamically on your machine, which means that the extension is not signed by Mozilla. For this reason, in order to use Authenticator, you need to configure Firefox with a `xpinstall.signatures.required` flag set to `false` (see [example](https://github.com/jan-molak/authenticator-browser-extension/tree/master/e2e/webdriverio)).\n\n**NOTE**: Firefox 48 (Pushed from Firefox 46) and newer [do not allow for unsigned extensions to be installed](https://wiki.mozilla.org/Add-ons/Extension_Signing#Timeline), so you need to use [Firefox Developer Edition](https://www.mozilla.org/en-GB/firefox/developer/) instead.\n\n## Your feedback matters!\n\nDo you find Authenticator useful? Give it a star! ★\n\nFound a bug? Need a feature? Raise [an issue](https://github.com/jan-molak/authenticator-browser-extension/issues?q=is%3Aopen) or submit a pull request.\n\nHave feedback? Let me know on twitter: [@JanMolak](https://twitter.com/JanMolak)\n\n## Before you go\n\n☕ If Authenticator has made your life a little bit easier and saved at least $5 worth of your time,\nplease consider repaying the favour and [buying me a coffee](https://github.com/sponsors/jan-molak) via [Github Sponsors](https://github.com/sponsors/jan-molak). Thanks! 🙏\n\n## License\nAuthenticator library is licensed under the Apache-2.0 license.\n\n_- Copyright \u0026copy; 2019- [Jan Molak](https://janmolak.com)_\n\n\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fjan-molak%2Fauthenticator-browser-extension.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fjan-molak%2Fauthenticator-browser-extension?ref=badge_large)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjan-molak%2Fauthenticator-browser-extension","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjan-molak%2Fauthenticator-browser-extension","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjan-molak%2Fauthenticator-browser-extension/lists"}