_example

command
v1.0.0-b001 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2018 License: MIT Imports: 7 Imported by: 0

README

go google oauth example

The goal of this example is to show a soup to nuts implementation of google oauth.

Instructions:

  1. You'll want to create a config.yml file in this folder, that will be where you put things like the google client / secret pair and other options.

An example config.yml:

googleAuth:
  clientID: "< YOUR CLIENT_ID HERE >"
  clientSecret: "< YOUR CLIENT_SECRET HERE >"
  hostedDomain: "< YOUR HOSTED DOMAIN HERE (ex: blend.com) >"

web:
  port: 5000 #up to you, this is a pretty standard default.
  baseURL: "< YOUR BASE URL HERE >"

Caveats:

  • You must configure an oauth credential set in the google cloud console.
  • You should add a local.app.xyz entry to that cloud configuration, and add a hosts entry map for that dns name to point to local host in /etc/hosts

    127.0.0.1 local.app.xyz

  • You should then set your web > baseURL entry to http://local.app.xyz

    it is not recommended to run your app on http outside your own machine.

  1. Start the app with:
> go run main.go
  1. You should be able to go to http://local.app.xyz in a browser and have it talk to the (very basic) app.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL