KO
|
EN
gitlite — search
Search
#javascript
#python
#hacktoberfest
#react
#ai
#typescript
#llm
#go
#golang
#android
#machine-learning
#rust
#deep-learning
#linux
microauth-slack
★ 8
Open GitHub ↗
Slack oauth for micro
Download README (.md)
Explore Similar Repositories
Fogg
:
PowerShell tool to aide and simplify the creation, deployment and provisioning of infrastructure in Azure
LegoNet
:
CNN框架设计(from zero to one)
Selenium.Utils
:
Selenium utilitu library to improve test creation
gladCode
:
Batalha de agentes virtuais inteligentes usando temática fantasia medieval
gpio_extension
:
Use raspberry GPIO directly in PHP 7 with this extension
// repository documentation
Was this content helpful?
★ 0
(0 ratings)
Select Rating:
★
★
★
★
★
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
microauth-slack
?
Download (.md)
# microauth-slack > Slack oauth for [micro](https://github.com/zeit/micro/) [](https://travis-ci.org/microauth/microauth-slack) [](https://github.com/sindresorhus/xo) [](https://greenkeeper.io/) Add [slack](https://slack.com) authentication to your [micro](https://github.com/zeit/micro/) service as easy as a flick of your fingers. This module is a part of [microauth](https://github.com/microauth/microauth) collection. ## Installation ```sh npm install --save microauth-slack # or yarn add microauth-slack ``` ## Usage app.js ```js const { send } = require('micro'); const microAuthSlack = require('microauth-slack'); const options = { 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(options); // Third `auth` argument will provide error or result of authentication // so it will { err: errorObject} or { result: { // provider: 'slack', // accessToken: 'blahblah', // info: userInfo // }} const handler = async (req, res, auth) => { if (!auth) { return send(res, 404, 'Not Found'); } if (auth.err) { // Error handler console.error(auth.err); return send(res, 403, 'Forbidden'); } // Save something in database here return `Hello ${auth.result.info.user.name}`; }; module.exports = slackAuth(handler); ``` Run: ```sh micro app.js ``` Now visit `http://localhost:3000/auth/slack` ## Author [Artem Karpovich](https://github.com/artemkarpovich)