{"id":13753122,"url":"https://github.com/microauth/microauth","last_synced_at":"2026-01-12T10:03:09.270Z","repository":{"id":217659287,"uuid":"88055330","full_name":"microauth/microauth","owner":"microauth","description":"Collection of authentication modules for ▲zeit's micro.","archived":false,"fork":false,"pushed_at":"2017-10-23T11:51:37.000Z","size":101,"stargazers_count":71,"open_issues_count":3,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-16T05:32:34.585Z","etag":null,"topics":["auth","authentication","javascript","js","micro","microauth","microservice","nodejs"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/microauth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2017-04-12T13:32:28.000Z","updated_at":"2024-10-31T18:25:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"26c210b6-13e6-4d59-ac96-c2661d6f2240","html_url":"https://github.com/microauth/microauth","commit_stats":null,"previous_names":["microauth/microauth"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microauth%2Fmicroauth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microauth%2Fmicroauth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microauth%2Fmicroauth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microauth%2Fmicroauth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/microauth","download_url":"https://codeload.github.com/microauth/microauth/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253321822,"owners_count":21890473,"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":["auth","authentication","javascript","js","micro","microauth","microservice","nodejs"],"created_at":"2024-08-03T09:01:16.597Z","updated_at":"2026-01-12T10:03:09.251Z","avatar_url":"https://github.com/microauth.png","language":null,"readme":"# microauth\n\u003e Collection of authentication modules for zeit's micro.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/microauth/microauth/blob/397dcd6f03d1620408a9607c552113208e1bee3c/media/logo.png\" alt=\"covr\" /\u003e\n\u003c/p\u003e\n\n## List of modules\n\n - [microauth-twitter](https://github.com/microauth/microauth-twitter)\n - [microauth-github](https://github.com/microauth/microauth-github)\n - [microauth-facebook](https://github.com/microauth/microauth-facebook)\n - [microauth-slack](https://github.com/microauth/microauth-slack)\n - [microauth-vkontakte](https://github.com/microauth/microauth-vkontakte)\n - [microauth-google](https://github.com/microauth/microauth-google)\n\n More providers, examples and documentation soon.\n\n## Usage example\n\nComposing several `microauth` modules:\n\n```js\nconst { send } = require('micro');\nconst compose = require('micro-compose');\nconst microAuthSlack = require('microauth-slack');\nconst microAuthGithub = require('microauth-github');\n\nconst githubOptions = {\n  clientId: 'client_id',\n  clientSecret: 'client_secret',\n  callbackUrl: 'http://localhost:3000/auth/github/callback',\n  path: '/auth/github',\n  scope: 'user'\n};\n\nconst slackOptions = {\n  clientId: 'client_id',\n  clientSecret: 'client_secret',\n  callbackUrl: 'http://localhost:3000/auth/slack/callback',\n  path: '/auth/slack',\n  scope: 'identity.basic,identity.team,identity.avatar'\n};\n\nconst slackAuth = microAuthSlack(slackOptions);\nconst githubAuth = microAuthGithub(githubOptions);\n\nconst handler = async (req, res, auth) =\u003e {\n\n  if (!auth) {\n    return send(res, 404, 'Not Found');\n  }\n\n  if (auth.err) {\n    console.error(auth.err);\n    return send(res, 403, 'Forbidden');\n  }\n\n  if (auth.result.provider === 'github') {\n    return `${auth.result.provider} provider. Hello ${auth.result.info.login}`;\n  } else if (auth.result.provider === 'slack') {\n    return `${auth.result.provider} provider. Hello ${auth.result.info.user.name}`;\n  } else {\n    return 'Unknown provider';\n  }\n\n};\n\nmodule.exports = compose(\n  slackAuth,\n  githubAuth\n)(handler);\n\n```\n\nNow go to `http://localhost:3000/auth/github` for github authentication or go to `http://localhost:3000/auth/slack` for slack authentication.\n\n## Authors\n- [Dima Paloskin](https://github.com/dimapaloskin)\n- [Artem Karpovich](https://github.com/artemkarpovich)\n- [Cody Brunner](https://github.com/rockchalkwushock)\n- [Rui Lima](https://github.com/rapzo)\n","funding_links":[],"categories":["nodejs"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicroauth%2Fmicroauth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicroauth%2Fmicroauth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicroauth%2Fmicroauth/lists"}