{"id":14957515,"url":"https://github.com/expressjs/basic-auth-connect","last_synced_at":"2025-05-16T06:07:58.895Z","repository":{"id":13049260,"uuid":"15729309","full_name":"expressjs/basic-auth-connect","owner":"expressjs","description":"Basic auth middleware for node and connect","archived":false,"fork":false,"pushed_at":"2024-09-30T10:15:00.000Z","size":14,"stargazers_count":130,"open_issues_count":2,"forks_count":27,"subscribers_count":18,"default_branch":"master","last_synced_at":"2024-10-29T14:24:26.299Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/expressjs.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"open_collective":"express"}},"created_at":"2014-01-08T08:02:40.000Z","updated_at":"2024-09-30T10:11:12.000Z","dependencies_parsed_at":"2024-11-28T23:10:41.458Z","dependency_job_id":null,"html_url":"https://github.com/expressjs/basic-auth-connect","commit_stats":{"total_commits":6,"total_committers":4,"mean_commits":1.5,"dds":0.6666666666666667,"last_synced_commit":"d3b6a633311654a5afc8102fc1c5c331a9eca684"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/expressjs%2Fbasic-auth-connect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/expressjs%2Fbasic-auth-connect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/expressjs%2Fbasic-auth-connect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/expressjs%2Fbasic-auth-connect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/expressjs","download_url":"https://codeload.github.com/expressjs/basic-auth-connect/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254478193,"owners_count":22077676,"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":"2024-09-24T13:15:01.585Z","updated_at":"2025-05-16T06:07:53.885Z","avatar_url":"https://github.com/expressjs.png","language":"JavaScript","funding_links":["https://opencollective.com/express"],"categories":[],"sub_categories":[],"readme":"# basic-auth-connect\n\nConnect's Basic Auth middleware in its own module. You should consider to create your own middleware with [basic-auth](https://github.com/visionmedia/node-basic-auth).\n\n## API\n\n```js\nvar basicAuth = require('basic-auth-connect');\n```\n\nSimple username and password\n\n```js\nconnect()\n.use(basicAuth('username', 'password'));\n```\n\nCallback verification\n\n```js\nconnect()\n.use(basicAuth(function(user, pass){\n  return 'tj' == user \u0026\u0026 'wahoo' == pass;\n}))\n```\n\nAsync callback verification, accepting `fn(err, user)`.\n\n```js\nconnect()\n.use(basicAuth(function(user, pass, fn){\n  User.authenticate({ user: user, pass: pass }, fn);\n}))\n```\n\n**Security Considerations**\n\nImportant: When using the callback method, it is recommended to use a time-safe comparison function like [crypto.timingSafeEqual](https://nodejs.org/api/crypto.html#cryptotimingsafeequala-b) to prevent timing attacks.\n\n## License\n\n[MIT](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexpressjs%2Fbasic-auth-connect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexpressjs%2Fbasic-auth-connect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexpressjs%2Fbasic-auth-connect/lists"}