All Projects → mxstbr → Micro Github

mxstbr / Micro Github

Licence: mit
A tiny microservice that makes adding authentication with GitHub to your application easy.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Micro Github

Micro Open Graph
A tiny Node.js microservice to scrape open graph data with joy.
Stars: ✭ 371 (-48.9%)
Mutual labels:  microservices, micro
Micro
Micro is a distributed cloud operating system
Stars: ✭ 10,778 (+1384.57%)
Mutual labels:  microservices, micro
Remit
RabbitMQ-backed microservices supporting RPC, pubsub, automatic service discovery and scaling with no code changes.
Stars: ✭ 24 (-96.69%)
Mutual labels:  microservices, micro
Xconf
分布式配置中心
Stars: ✭ 185 (-74.52%)
Mutual labels:  microservices, micro
Microservices
micro 微服务实例教程,包含JWT鉴权、熔断、监控、链路追踪、健康检查、跨域等
Stars: ✭ 341 (-53.03%)
Mutual labels:  microservices, micro
Go Micro
A pluggable Go framework for distributed systems development
Stars: ✭ 17,350 (+2289.81%)
Mutual labels:  microservices, micro
Micro Starter Kit
Cloud Native GoLang Microservices - gRPC, GraphQL
Stars: ✭ 167 (-77%)
Mutual labels:  microservices, micro
Wl Micro Frontends
Micro front end practical project tutorial. 微前端项目实战vue项目。基于vue3.0&qiankun2.0进阶版:https://github.com/wl-ui/wl-mfe
Stars: ✭ 366 (-49.59%)
Mutual labels:  microservices, micro
Micro
go-micro 微服务实践,更多请关注Micro中国站☞
Stars: ✭ 383 (-47.25%)
Mutual labels:  microservices, micro
Micro Router
🚉 A tiny and functional router for Zeit's Micro
Stars: ✭ 621 (-14.46%)
Mutual labels:  micro
Vertx Blueprint Microservice
Vert.x Blueprint Project - Micro-Shop microservice application
Stars: ✭ 663 (-8.68%)
Mutual labels:  microservices
Github Trending Api
The missing APIs for GitHub trending projects and developers 📈
Stars: ✭ 617 (-15.01%)
Mutual labels:  github-api
Avatar
💎 Beautiful avatars as a microservice
Stars: ✭ 623 (-14.19%)
Mutual labels:  micro
Apollo
Apollo is a reliable configuration management system suitable for microservice configuration management scenarios.
Stars: ✭ 26,052 (+3488.43%)
Mutual labels:  microservices
Auth Service
spring security + oauth2.0 + jwt
Stars: ✭ 622 (-14.33%)
Mutual labels:  microservices
Nodebootstrap
NodeBootstrap - generates skeleton project for Node/Express.js with pre-configured best-practices. Kick-start your Node project development with tons of boilerplate taken care of, such as: clustering, Docker-support, database migrations, automated testing, error-handling, modularity, advanced logging, templated views, environments etc.
Stars: ✭ 707 (-2.62%)
Mutual labels:  microservices
Grpclib
Pure-Python gRPC implementation for asyncio
Stars: ✭ 615 (-15.29%)
Mutual labels:  microservices
Microservices Framework Benchmark
Raw benchmarks on throughput, latency and transfer of Hello World on popular microservices frameworks
Stars: ✭ 615 (-15.29%)
Mutual labels:  microservices
Open Lambda
An open source serverless computing platform
Stars: ✭ 718 (-1.1%)
Mutual labels:  microservices
Spring Cloud Consul
Spring Cloud Consul
Stars: ✭ 703 (-3.17%)
Mutual labels:  microservices

micro-github

A tiny microservice that makes adding authentication with GitHub to your application easy.

Usage

Running your own micro-github is a single now command away:

# Deploy this repository using now.sh
now mxstbr/micro-github -e GH_CLIENT_ID=xyz123 -e GH_CLIENT_SECRET=asdf123 -e REDIRECT_URL=https://google.com

Environment variables

You'll need to provide three environment variables when running micro-github:

# Your GitHub application client id
GH_CLIENT_ID=xyz123
# Your GitHub application client secret
GH_CLIENT_SECRET=asdf123
# The URL to redirect the user to once the authentication was successful
REDIRECT_URL=https://google.com
# Optional: Specify the GitHub host when using GitHub Enterprise
GH_HOST=github.my-company.com

Create an application on GitHub here to get your client id and secret if you haven't done that already.

When authentication is successful, the user will be redirected to the REDIRECT_URL with the access_token query param set to the GitHub access token. You can then use that token to interact with the GitHub API!

E.g. setting REDIRECT_URL=https://google.com will redirect them to https://google.com/?access_token=asdf123. (where asdf123 is the provided access token)

Finish setup

To make this work you have to set the authorization callback URL of your application on GitHub to whatever URL now gave you plus the path /callback e.g. http://localhost:3000/callback:

Authorization callback URL: 'your-url.now.sh'

To log people in provide a link to url now gave you plus the path login e.g. http://localhost:3000/login when they click on the link it will redirect to https://github.com/login/oauth/authorize?client_id=asdf123&state. (where client_id is your GitHub app client id in .env and state is a randomly generated string). This will redirect them to the GitHub sign in page for your app, which looks like this:

Authorize my app to access your data on GitHub

You can change the scope of the data you can access with the scope query param, see the GitHub docs!

When authentication is successful, the user will be redirected to the REDIRECT_URL with the access token from GitHub for you to use! 🎉

Error handling

In case an error happens (either by the service or on GitHub) the user will be redirected to the REDIRECT_URL with the error query param set to a relevant error message.

Development

git clone [email protected]:mxstbr/micro-github.git

Move .env.example to .env and fill in your GitHub API details and redirect url

npm run dev

The server will then be listening at localhost:3000, so set the authorization callback URL of your dev application on GitHub to http://localhost:3000/callback.

Updating

The master branch of this repository is what you will be deploying. To update to a new version with potential bugfixes, all you have to do is run the now command again and then set the authorization callback URL on GitHub to the new URL that now gave you! 👌

License

Copyright (c) 2017 Maximilian Stoiber, licensed under the MIT license. See LICENSE.md for more information.

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].