Giter Club home page Giter Club logo

gh-oauth-gcp's Introduction

gh-oauth-gcp

https://otamachan.github.io/gh-oauth-gcp/

This is a sample web page application using GitHub OAuth. A web page only application cannot use GitHub OAuth because its endpoint does not support CORS. isaacs/github#330 . In this sample application, I use Cloud Functions to enable GitHub OAuth login with CORS support.

HowTo

Initial setup

# create a project
gcloud projects create gh-oauth-gcp
# set a project
gcloud config set project gh-oauth-gcp
# enable billing
sensible-browser https://console.cloud.google.com/
# enable services
gcloud services enable cloudfunctions.googleapis.com cloudbuild.googleapis.com secretmanager.googleapis.com
# set a region
gcloud config set functions/region asia-northeast1
# create a secret
gcloud secrets create secrets --replication-policy="automatic"
# set a secret
echo -n '{"client_id":"xxx","client_secret":"yyyy"}' | gcloud secrets versions add secrets --data-file=-
# apply permission
gcloud secrets add-iam-policy-binding secrets --role roles/secretmanager.secretAccessor --member serviceAccount:[email protected]

Deploy

# deploy a function
gcloud functions deploy login --entry-point login --runtime python38 --trigger-http --allow-unauthenticated --memory 128MB --timeout 5 --env-vars-file env.yaml

gh-oauth-gcp's People

Contributors

otamachan avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.