Edge-side GitHub authentication

Overview

cloudflare-workers-github-auth

Edge-side GitHub authentication example.

Requirements

  • node.js (v16.13.1 or later)

Installation

Clone this repository and install dependent packages, and sign into Cloudflare.

git clone https://github.com/ysugimoto/cloudflare-workers-github-auth.git
cd cloudflare-workers-github-auth
yarn
yarn login

The yarn login calls wrangler login.

And make sure your GitHub OAuth app has been created. Put GitHub app secrets to wrangler.toml:

" GITHUB_CLIENT_SECRET = " " GITHUB_REDIRECT_URI="http://localhost:8787/signin/callback"">
[vars]
GITHUB_CLIENT_ID = "
     
      "
     
GITHUB_CLIENT_SECRET = "
     
      "
     
GITHUB_REDIRECT_URI="http://localhost:8787/signin/callback"

Then, you can confirm this app behavior in your local environment.

yarn dev

You can see the application in http://localhost:8787 via miniflare.

Deployment

First, you need to create wrangler.production.toml. Example file exists:

cp wrangler.production.toml.example wrangler.production.toml

And need to modify settings in wrangler.production.toml:

kv_namespaces = [
  { binding = "SESSION", id = "find your KV id in dashboard" },
  { binding = "STATE", id = "find your KV id in dashboard" },
]

[vars]
GITHUB_CLIENT_ID="
   
    "
   
GITHUB_CLIENT_SECRET="
   
    "
   
GITHUB_REDIRECT_URI="https://
   
    /signin/callback
    "
   

And you need to create Workers KV via your Cloudflare dashboard like https://dash.cloudflare.com/ /workers/kv/namespaces and after create them, put KV namespace id for each kv_namespaces bindings.

Then, finally you can deploy workers in your account!

yarn deploy

Author

Yoshiaki Sugimoto [email protected]

You might also like...

The authentication-server is a node app that handles user registration, authentication & authorization with JWT.

The authentication-server is a node app that handles user registration, authentication & authorization with JWT.

Authentication Server The authentication-server is a node app that handles user registration, authentication & authorization with JWT. Here is the REP

Jul 24, 2022

We are creating a Library that would ensure developers do not reinvent the wheel anymore as far as Authentication is concerned. Developers can easily register and download authentication codes that suits their need at any point.

We are creating a Library that would ensure developers do not reinvent the wheel anymore as far as Authentication is concerned. Developers can easily register and download authentication codes that suits their need at any point.

#AuthWiki Resource Product Documentation Figma Database Schema First Presentation Live Link API Documentation Individual Contributions User Activity U

Dec 2, 2022

Make drag-and-drop easier using DropPoint. Drag content without having to open side-by-side windows

Make drag-and-drop easier using DropPoint. Drag content without having to open side-by-side windows

Make drag-and-drop easier using DropPoint! DropPoint helps you drag content without having to open side-by-side windows Works on Windows, Linux and Ma

Dec 29, 2022

This is an application that entered the market with a mobile application in real life. We wrote the backend side with node.js and the mobile side with flutter.

HAUSE TAXI API Get Started Must be installed on your computer Git Node Firebase Database Config You should read this easy documentation Firebase-Fires

Nov 4, 2021

Fast and minimal JS head server-side writer and client-side manager.

unihead Fast and minimal JS head server-side writer and client-side manager. Nearly every SSR framework out there relies on server-side components t

Sep 4, 2022

This plugin allows side-by-side notetaking with videos. Annotate your notes with timestamps to directly control the video and remember where each note comes from.

Obsidian Timestamp Notes Use Case Hello Obsidian users! Like all of you, I love using Obsidian for taking notes. My usual workflow is a video in my br

Jan 2, 2023

Easy server-side and client-side validation for FormData, URLSearchParams and JSON data in your Fresh app 🍋

Fresh Validation 🍋     Easily validate FormData, URLSearchParams and JSON data in your Fresh app server-side or client-side! Validation Fresh Validat

Dec 23, 2022

This Plugin is For Logseq. If you're using wide monitors, you can place journals, linked references, and journal queries side by side.

This Plugin is For Logseq. If you're using wide monitors, you can place journals, linked references, and journal queries side by side.

Logseq Column-Layout Plugin Journals, linked references, and journal queries can be placed side by side if the minimum screen width is "1850px" or mor

Dec 14, 2022

A GitHub Action to generate reports that contain all the SSH keys, personal access tokens, GitHub App installations, deploy keys and their respective permissions authorized against a GitHub organization.

A GitHub Action to generate reports that contain all the SSH keys, personal access tokens, GitHub App installations, deploy keys and their respective permissions authorized against a GitHub organization.

Dec 13, 2022

Mad science p2p pipe across the web using webrtc that uses your Github private/public key for authentication and a signalhub for discovery

webcat Mad science p2p pipe across the web using webrtc that uses your Github private/public key for authentication and a signalhub for discovery We a

Dec 30, 2022

Third-Party Authentication (Github) demo Vue 3 + TypeScript + Pinia app using Supabase

vue-supabase-tpa-demo This template should help get you started developing with Vue 3 in Vite. Recommended IDE Setup VSCode + Volar (and disable Vetur

Nov 21, 2022

Source code for Chrome/Edge/Firefox/Opera extension Magic CSS (Live editor for CSS, Less & Sass)

Live editor for CSS, Less & Sass (Magic CSS) Extension Live editor for CSS, Less & Sass (Magic CSS) for Google Chrome, Microsoft Edge, Mozilla Firefox

Dec 13, 2022

Streamline Your Node.js Debugging Workflow with Chromium (Chrome, Edge, More) DevTools.

Streamline Your Node.js Debugging Workflow with Chromium (Chrome, Edge, More) DevTools.

NiM (Node.js --inspector Manager) Streamlines your development process Google Chrome Web Store (works with any Chromium browsers: Google's Chrome, Mic

Dec 28, 2022

Infinite Red's cutting edge React Native project boilerplate, along with a CLI, component/model generators, and more!

Infinite Red's cutting edge React Native project boilerplate, along with a CLI, component/model generators, and more!

Ignite - the hottest React Native boilerplate Battle-tested React Native boilerplate The culmination of five years of constant React Native developmen

Dec 29, 2022

CrossUI is a free Cross-Browser Javascript framework with cutting-edge functionality for rich web application

CrossUI is a free Cross-Browser Javascript framework with cutting-edge functionality for rich web application

CrossUI is a free Cross-Browser Javascript framework with cutting-edge functionality for rich web application

Jan 3, 2023

A lightweight Apple Music client for Windows, built with MusicKit JS, Edge WebView2 and React.

A lightweight Apple Music client for Windows, built with MusicKit JS, Edge WebView2 and React.

Lito Music English | 中文 Lito (/laɪto/) Music is a lightweight Apple Music client for Windows, built with MusicKit JS, Edge WebView2 and React. System

Dec 30, 2022

ExtensĂŁo de temas para o site Gatry.com, compatĂ­vel com Firefox, Chrome e Edge.

ExtensĂŁo de temas  para o site Gatry.com, compatĂ­vel com Firefox, Chrome e Edge.

Gatry Shades Extensão que dá a possibilidade de aplicar temas ao site gatry.com, bem como demais funcionalidade para reduzir a luminosidade de imagens

Dec 3, 2022

🚀 A web extension starter built with React, Typescript, and Tailwind CSS. Build once, and run on multiple browsers: Google Chrome, Mozilla Firefox, Microsoft Edge, Brave, and Opera..

🚀 A web extension starter built with React, Typescript, and Tailwind CSS. Build once, and run on multiple browsers: Google Chrome, Mozilla Firefox, Microsoft Edge, Brave, and Opera..

Web Extension Starter A web extension starter, built with React, Typescript, and Tailwind CSS. Build once, and run on multiple browsers: Google Chrome

Dec 28, 2022

ACME client microservice for the Cumulocity IoT Edge to automatically issue and renew valid certificates via e.g. Let's Encrypt.

Cumulocity IoT Edge - ACME This repository contains the sources for an ACME microservice that can be used to periodically issue/renew certificates for

May 3, 2022
Owner
Yoshiaki Sugimoto
DevOps enthusiast
Yoshiaki Sugimoto
Simple, unobtrusive authentication for Node.js.

Passport Passport is Express-compatible authentication middleware for Node.js. Passport's sole purpose is to authenticate requests, which it does thro

Jared Hanson 21k Jan 7, 2023
Authentication solution for Express

Lockit Lockit is an authentication solution for Express. Check out the demo. It consists of multiple single purpose modules: lockit-login lockit-signu

Mirco Zeiss 445 Dec 28, 2022
A small project with 3 accounts mapped to 3 resources using auth0 as an authentication service.

Auth0WithExpressJS Quickstart install dependencies for backend and start backend cd Auth0WithExpressJS\Back && npm start install dependencies for fron

RYMND 16 Aug 21, 2021
Role based authentication for NodeJS and ExpressJS

Authentication service made for ExpressJS and MongoDB using JWT. We tried to make it as clean and structured as possible. We also provide this documentation on how to install and integrate it with your own application.

null 4 Oct 3, 2021
An easy to use authentication system that can easily be built in to your Express + HBS web apps.

yoAuth An easy to use authentication system that can easily be built in to your Express + HBS web apps. Currently only supports local authentication,

null 2 Jan 21, 2022
Building an API on nodejs with registration system, authentication, CRUD of projects and tasks.

api-token-express Building an API on nodejs with registration system, authentication, CRUD of projects and tasks. API endpoints POST { "username":

MrDiniz 4 Jan 15, 2022
Authenticated server-side rendering with Nuxt 3 and Firebase 9

Authenticated server-side rendering with Nuxt 3 and Firebase 9.

Robert Soriano 51 Dec 23, 2022
EveryAuth is the easiest way for your app to access APIs like Slack, Salesforce, or Github.

EveryAuth EveryAuth is the easiest way for your app to access APIs like Slack, Salesforce, or Github. import everyauth from "@fusebit/everyauth-expres

Fusebit 13 Dec 12, 2022