All Projects → microauth → microauth

microauth / microauth

Licence: other
Collection of authentication modules for ▲zeit's micro.

Projects that are alternatives of or similar to microauth

Go Os
Stars: ✭ 185 (+160.56%)
Mutual labels:  auth, micro
worker-auth-providers
worker-auth-providers is an open-source providers to make authentication easy with workers. Very lightweight script which doesn't need a lot of dependencies. Plug it with any framework or template of workers.
Stars: ✭ 85 (+19.72%)
Mutual labels:  auth
lua-resty-feishu-auth
适用于 OpenResty / ngx_lua 的基于飞书组织架构的登录认证
Stars: ✭ 28 (-60.56%)
Mutual labels:  auth
react-google-oauth2.0
React frontend login with OAuth 2.0 & integrates a Rest API backend.
Stars: ✭ 14 (-80.28%)
Mutual labels:  auth
micro-next
Integrations between Micro and Next.js
Stars: ✭ 20 (-71.83%)
Mutual labels:  micro
sqlalchemy-adapter
SQLAlchemy Adapter for PyCasbin
Stars: ✭ 53 (-25.35%)
Mutual labels:  auth
micro-visualize
Visualizes requests and responses for services written with micro
Stars: ✭ 55 (-22.54%)
Mutual labels:  micro
mod authnz jwt
An authentication module for Apache httpd using JSON Web Tokens
Stars: ✭ 74 (+4.23%)
Mutual labels:  auth
sqlx-adapter
Asynchronous casbin adapter for mysql, postgres, sqlite based on sqlx-rs
Stars: ✭ 27 (-61.97%)
Mutual labels:  auth
micro-airtable-api
Quickly make an API from Airtable
Stars: ✭ 30 (-57.75%)
Mutual labels:  micro
soosyze
🌠 Soosyze CMS is a minimalist content management system in PHP, without database to create and manage your website easily. https://soosyze.com
Stars: ✭ 39 (-45.07%)
Mutual labels:  micro
dokku-http-auth
dokku plugin that gives the ability to manage HTTP basic auth for an application
Stars: ✭ 71 (+0%)
Mutual labels:  auth
gtoken
基于gf框架的token插件,通过服务端验证方式实现token认证;
Stars: ✭ 181 (+154.93%)
Mutual labels:  auth
2fa-notifier
2FA Notifier is a web extension that notifies users whether or not the sites they visit support two factor authentication (2FA).
Stars: ✭ 39 (-45.07%)
Mutual labels:  auth
PiggyAuth
Safe & feature-rich auth plugin. Project has been discontinued
Stars: ✭ 33 (-53.52%)
Mutual labels:  auth
k8s-pixy-auth
k8s plugin to authenticate against an OIDC compatible issuer using PKCE (pixy) flow
Stars: ✭ 24 (-66.2%)
Mutual labels:  auth
micro-swagger
Swagger generate and Swagger web server. It's redefined document for coder.
Stars: ✭ 34 (-52.11%)
Mutual labels:  micro
Micro
Micro is coming back!
Stars: ✭ 11 (-84.51%)
Mutual labels:  micro
amplify-material-ui
A Material-UI based implementation of aws amplify
Stars: ✭ 32 (-54.93%)
Mutual labels:  auth
react-auth-kit
Easily manage Authentication state of users in React-based Apps using Hooks and Higher-order components
Stars: ✭ 177 (+149.3%)
Mutual labels:  auth

microauth

Collection of authentication modules for zeit's micro.

covr

List of modules

More providers, examples and documentation soon.

Usage example

Composing several microauth modules:

const { send } = require('micro');
const compose = require('micro-compose');
const microAuthSlack = require('microauth-slack');
const microAuthGithub = require('microauth-github');

const githubOptions = {
  clientId: 'client_id',
  clientSecret: 'client_secret',
  callbackUrl: 'http://localhost:3000/auth/github/callback',
  path: '/auth/github',
  scope: 'user'
};

const slackOptions = {
  clientId: 'client_id',
  clientSecret: 'client_secret',
  callbackUrl: 'http://localhost:3000/auth/slack/callback',
  path: '/auth/slack',
  scope: 'identity.basic,identity.team,identity.avatar'
};

const slackAuth = microAuthSlack(slackOptions);
const githubAuth = microAuthGithub(githubOptions);

const handler = async (req, res, auth) => {

  if (!auth) {
    return send(res, 404, 'Not Found');
  }

  if (auth.err) {
    console.error(auth.err);
    return send(res, 403, 'Forbidden');
  }

  if (auth.result.provider === 'github') {
    return `${auth.result.provider} provider. Hello ${auth.result.info.login}`;
  } else if (auth.result.provider === 'slack') {
    return `${auth.result.provider} provider. Hello ${auth.result.info.user.name}`;
  } else {
    return 'Unknown provider';
  }

};

module.exports = compose(
  slackAuth,
  githubAuth
)(handler);

Now go to http://localhost:3000/auth/github for github authentication or go to http://localhost:3000/auth/slack for slack authentication.

Authors

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].