• Stars
    star
    4,979
  • Rank 7,998 (Top 0.2 %)
  • Language
    Go
  • License
    MIT License
  • Created over 9 years ago
  • Updated 6 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Package goth provides a simple, clean, and idiomatic way to write authentication packages for Go web applications.

Goth: Multi-Provider Authentication for Go GoDoc Build Status Go Report Card

Package goth provides a simple, clean, and idiomatic way to write authentication packages for Go web applications.

Unlike other similar packages, Goth, lets you write OAuth, OAuth2, or any other protocol providers, as long as they implement the Provider and Session interfaces.

This package was inspired by https://github.com/intridea/omniauth.

Installation

$ go get github.com/markbates/goth

Supported Providers

  • Amazon
  • Apple
  • Auth0
  • Azure AD
  • Battle.net
  • Bitbucket
  • Box
  • ClassLink
  • Cloud Foundry
  • Dailymotion
  • Deezer
  • DigitalOcean
  • Discord
  • Dropbox
  • Eve Online
  • Facebook
  • Fitbit
  • Gitea
  • GitHub
  • Gitlab
  • Google
  • Google+ (deprecated)
  • Heroku
  • InfluxCloud
  • Instagram
  • Intercom
  • Kakao
  • Lastfm
  • LINE
  • Linkedin
  • Mailru
  • Meetup
  • MicrosoftOnline
  • Naver
  • Nextcloud
  • Okta
  • OneDrive
  • OpenID Connect (auto discovery)
  • Oura
  • Patreon
  • Paypal
  • SalesForce
  • Shopify
  • Slack
  • Soundcloud
  • Spotify
  • Steam
  • Strava
  • Stripe
  • TikTok
  • Tumblr
  • Twitch
  • Twitter
  • Typetalk
  • Uber
  • VK
  • WeCom
  • Wepay
  • Xero
  • Yahoo
  • Yammer
  • Yandex
  • Zoom

Examples

See the examples folder for a working application that lets users authenticate through Twitter, Facebook, Google Plus etc.

To run the example either clone the source from GitHub

$ git clone [email protected]:markbates/goth.git

or use

$ go get github.com/markbates/goth
$ cd goth/examples
$ go get -v
$ go build
$ ./examples

Now open up your browser and go to http://localhost:3000 to see the example.

To actually use the different providers, please make sure you set environment variables. Example given in the examples/main.go file

Security Notes

By default, gothic uses a CookieStore from the gorilla/sessions package to store session data.

As configured, this default store (gothic.Store) will generate cookies with Options:

&Options{
   Path:   "/",
   Domain: "",
   MaxAge: 86400 * 30,
   HttpOnly: true,
   Secure: false,
 }

To tailor these fields for your application, you can override the gothic.Store variable at startup.

The following snippet shows one way to do this:

key := ""             // Replace with your SESSION_SECRET or similar
maxAge := 86400 * 30  // 30 days
isProd := false       // Set to true when serving over https

store := sessions.NewCookieStore([]byte(key))
store.MaxAge(maxAge)
store.Options.Path = "/"
store.Options.HttpOnly = true   // HttpOnly should always be enabled
store.Options.Secure = isProd

gothic.Store = store

Issues

Issues always stand a significantly better chance of getting fixed if they are accompanied by a pull request.

Contributing

Would I love to see more providers? Certainly! Would you love to contribute one? Hopefully, yes!

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Write Tests!
  4. Make sure the codebase adhere to the Go coding standards by executing gofmt -s -w ./
  5. Commit your changes (git commit -am 'Add some feature')
  6. Push to the branch (git push origin my-new-feature)
  7. Create new Pull Request

More Repositories

1

pkger

Embed static files in Go binaries (replacement for gobuffalo/packr)
Go
1,187
star
2

configatron

A super cool, simple, and feature rich configuration system for Ruby apps.
Ruby
602
star
3

grift

Go based task runner
Go
431
star
4

coffee-rails-source-maps

DO NOT USE THIS!! I DO NOT MAINTAIN IT!
Ruby
241
star
5

coffeebeans

The parts of CoffeeScript they forgot in Rails 3.1!
Ruby
229
star
6

cover_me

An RCov-esque coverage tool for Ruby 1.9
Ruby
204
star
7

refresh

Go
190
star
8

jquery-bootstrap-pagination

CoffeeScript
91
star
9

Programming-In-CoffeeScript

Source code for the Programming in CoffeeScript book.
CoffeeScript
63
star
10

going

Some helpful packages for writing Go apps.
Go
54
star
11

dj_remixes

Enhancements and improvements for Delayed Job 2.x
Ruby
42
star
12

mack

A Ruby web application framework
Ruby
39
star
13

warp_drive

Screw Rails Engines! Why not install a Warp Drive! Completely bundle up an ENTIRE Rails application into a gem, then load it into another application! It's that easy!
Ruby
34
star
14

myvim

My VIM setup. Use at your own risk.
Vim Script
34
star
15

buffla

URL Shortner written in Buffalo
Go
30
star
16

inflect

DEPRECATED: use github.com/gobuffalo/flect instead
Go
24
star
17

fluent-2014

Source code for the Angular Fundamentals workshop at FluentConf 2014.
JavaScript
22
star
18

ghi

Offline GitHub Issues Client
Go
19
star
19

cachetastic

A very simple, yet very powerful caching framework for Ruby
Ruby
18
star
20

delayed_job_extras

This project has moved to markbates/dj_remixes. Please do not follow this project!
Ruby
17
star
21

buffalo-heroku

Archived use github.com/gobuffalo/buffalo-heroku
Go
17
star
22

mongoid-tags-arent-hard

A tagging gem for Mongoid 3 that doesn't actually suck.
Ruby
16
star
23

distribunaut

A framework agnostic port of the mack-distributed package.
Ruby
16
star
24

yamler

Tools for using YAML w/ Ruby easier.
Ruby
11
star
25

gormrecipe

An example of using Gorm with Buffalo
Go
10
star
26

mack-more

All the extra stuff you could want for the Mack Framework.
Ruby
10
star
27

mongoid_delorean

THIS PROJECT IS NOT MAINTAINED. USE AT YOUR OWN RISK. NO PRs ACCEPTED.
Ruby
9
star
28

genosaurus

A simple and easy to use generator system for Ruby
Ruby
9
star
29

gocker

Go
9
star
30

informit_articles

InformIT Articles
Ruby
7
star
31

macker-s-guide

A User's Guide to the Mack Framework
JavaScript
7
star
32

gemstub

A simple gem for creating the stub of other gems
Ruby
7
star
33

api_doc

Easily generate API docs from RSpec/Rails
Ruby
7
star
34

faraday_bang

Adds error raising ! methods to Faraday
Ruby
6
star
35

gem-freezer

A simple gem that helps you freeze gems, and their dependencies into your project.
Ruby
5
star
36

contextual

context.Context utilities
Go
5
star
37

wailsx

WIP: Tools for working with Wails.io
Go
5
star
38

nor-dev

Development Playground for Node on Rails (NOR)
CoffeeScript
4
star
39

willie

Easy testing of Go web type stuff
Go
4
star
40

cash

A Go package for working with cash.Money :)
Go
4
star
41

oncer

Go
4
star
42

markdownr

Go
4
star
43

gobular

Go Regular Expression Tester
Go
4
star
44

gemtronics

A much better of managing your gem dependencies
Ruby
3
star
45

breach

Ruby
3
star
46

buffalo-bootstrap

A plugin for github.com/gobuffalo/buffalo for generating Bootstrap stuff
Go
3
star
47

deplist

Get a list of all the Go dependencies for the current directory
Go
3
star
48

braai

Fully Extensible Templates
Ruby
3
star
49

mack-user_auth_portlet

A collection of Portlets for the Mack Framework
Ruby
3
star
50

deano

A starter template for Sinatra Applications
Ruby
3
star
51

buffalo-rails

Go
3
star
52

sigtx

a context implementation for signal capturing
Go
3
star
53

micro-mack

A 'micro' version of the Mack Framework
Ruby
3
star
54

miki

A lightweight, Mack-based Wiki powering www.mackwiki.com
Ruby
3
star
55

jim

Go
3
star
56

mocha-coffeescript-tmbundle

TextMate/Sublime Text 2 bundle for Mocha (CoffeeScript)
2
star
57

bluffalo

Go
2
star
58

errx

Makefile
2
star
59

coke

Go
2
star
60

mark_facets

Just a collection of common extensions and add-ons I use in most Ruby/Rails projects.
Ruby
2
star
61

assoc

Go
2
star
62

chalk

Quickly and easily create a pool of `go routines`.
Go
2
star
63

rails_templates

Templates for building Rails applications
Ruby
2
star
64

control

Go
2
star
65

ekar

Ekar, a Rake replacement, maybe?
Ruby
2
star
66

rack-cachely

Rack Middleware for working with the CachelyApp Page Cache Service
Ruby
2
star
67

syncx

Go
2
star
68

opal-rb-example

A "todo" example using the Opal.rb Project.
Ruby
2
star
69

snooze_force

SnoozeForce - A Client for Saleforce.com's REST API
Ruby
2
star
70

blabber_mouth

Easy model-like notification system for Ruby. (A framework agnostic port of the mack-notifier package.)
Ruby
2
star
71

bostongo

Go
2
star
72

mytmux

1
star
73

ringo

Go
1
star
74

labs

Go
1
star
75

gjs

HTML
1
star
76

haste

Go
1
star
77

ek

A simple echo server
Go
1
star
78

content_o_matic

A gem to download the contents of a page and include them into your application.
Ruby
1
star
79

FakeWeb.js

A port of FakeWeb (Ruby) to help test JavaScript AJAX apps
CoffeeScript
1
star
80

gurl

Go
1
star
81

tt

T.T. The Test Running Bear!
Go
1
star
82

gonit

Go
1
star
83

bert

Go
1
star
84

cleo

Go
1
star
85

buffalo-trash

Go
1
star
86

bloggy

HTML
1
star
87

markbates.github.com

HTML
1
star
88

gentronics

Go
1
star
89

clio

Go
1
star
90

clam

Go
1
star
91

cobble

A very simple and easy library to help facilitate the building and creating of objects.
Ruby
1
star
92

konacha-sinatra

Ruby
1
star
93

hmax

A Golang package to make working with HMAC requests easier.
Go
1
star
94

safe

Go
1
star