All Projects → Shareed2k → goth_fiber

Shareed2k / goth_fiber

Licence: MIT license
Package goth_fiber provides a simple, clean, and idiomatic way to write authentication packages for fiber framework applications.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to goth fiber

AzureADAuthRazorUiServiceApiCertificate
Azure AD flows using ASP.NET Core and Microsoft.Identity
Stars: ✭ 41 (+57.69%)
Mutual labels:  oauth, oauth2
Twitch
[READ ONLY] Subtree split of the SocialiteProviders/Twitch Provider (see SocialiteProviders/Providers)
Stars: ✭ 20 (-23.08%)
Mutual labels:  oauth, oauth2
Slack
[READ ONLY] Subtree split of the SocialiteProviders/Slack Provider (see SocialiteProviders/Providers)
Stars: ✭ 11 (-57.69%)
Mutual labels:  oauth, oauth2
Authlib
The ultimate Python library in building OAuth, OpenID Connect clients and servers. JWS,JWE,JWK,JWA,JWT included.
Stars: ✭ 2,854 (+10876.92%)
Mutual labels:  oauth, oauth2
lumen-oauth2
OAuth2 module for the Lumen PHP framework.
Stars: ✭ 29 (+11.54%)
Mutual labels:  oauth, oauth2
Pow assent
Multi-provider authentication for your Pow enabled app
Stars: ✭ 236 (+807.69%)
Mutual labels:  oauth, oauth2
instagram-oauth-nodejs-server
Node.js server for Intagram-API OAuth purpose.
Stars: ✭ 12 (-53.85%)
Mutual labels:  oauth, oauth2
Portfolio Generator
HoxNox - Portfolios Made Easy, Generate portfolios in 3 easy steps
Stars: ✭ 166 (+538.46%)
Mutual labels:  oauth, oauth2
Spotify
[READ ONLY] Subtree split of the SocialiteProviders/Spotify Provider (see SocialiteProviders/Providers)
Stars: ✭ 13 (-50%)
Mutual labels:  oauth, oauth2
IdentityServer4.PhoneNumberAuth
Sample passwordless phone number authentication using OAuth in ASP.NET Core 2.2
Stars: ✭ 83 (+219.23%)
Mutual labels:  oauth, oauth2
Express Starter
It's a hackathon-starter fork, but designed to use PostgreSQL by default (or MySQL)
Stars: ✭ 215 (+726.92%)
Mutual labels:  oauth, oauth2
VKontakte
[READ ONLY] Subtree split of the SocialiteProviders/VKontakte Provider (see SocialiteProviders/Providers)
Stars: ✭ 82 (+215.38%)
Mutual labels:  oauth, oauth2
Oauthlib
A generic, spec-compliant, thorough implementation of the OAuth request-signing logic
Stars: ✭ 2,323 (+8834.62%)
Mutual labels:  oauth, oauth2
Authing
🔥Authing - IDaaS/IAM solution that can Auth to web and mobile applications.
Stars: ✭ 247 (+850%)
Mutual labels:  oauth, oauth2
External Auth Server
easy auth for reverse proxies
Stars: ✭ 189 (+626.92%)
Mutual labels:  oauth, oauth2
sample-oauth2-client
Sample OAuth2 client using the GitHub API
Stars: ✭ 69 (+165.38%)
Mutual labels:  oauth, oauth2
Fresh
🍋 A token refresh library for Dart.
Stars: ✭ 128 (+392.31%)
Mutual labels:  oauth, oauth2
Ngx Oauth
OAuth 2.0 proxy for nginx written in Lua.
Stars: ✭ 146 (+461.54%)
Mutual labels:  oauth, oauth2
oauth2-server
A spec compliant, secure by default PHP OAuth 2.0 Server
Stars: ✭ 6,128 (+23469.23%)
Mutual labels:  oauth, oauth2
yii-auth-client
Yii Framework external authentication via OAuth and OpenID Extension
Stars: ✭ 20 (-23.08%)
Mutual labels:  oauth, oauth2

Goth-Fiber: Multi-Provider Authentication for Go GoDoc

Is wrapper for goth library to use with fiber Framework, 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.

Installation

$ go get github.com/shareed2k/goth_fiber

Supported Providers

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

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]/shareed2k/goth_fiber.git
$ go get github.com/shareed2k/goth_fiber
$ cd goth_fiber/examples
$ go get -v
$ go build
$ ./examples

Now open up your browser and go to http://localhost:8088/login/google 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, goth_fiber uses a Session from the gofiber/session package to store session data.

As configured, goth will generate cookies with the following session.Config:

    session.Config{
	    Expiration: 24 * time.Hour,
	    Storage:    memory.New(),
	    KeyLookup: "cookie:_gothic_session",
	    CookieDomain: "",
	    CookiePath: "",
	    CookieSecure: false,
	    CookieHTTPOnly: true,
	    CookieSameSite: "Lax",
	    KeyGenerator: utils.UUIDv4,
	}

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

The following snippet shows one way to do this:

    // optional config
    config := session.Config{
	    Expiration:     30 * time.Minutes,
	    Storage:        sqlite3.New(), // From github.com/gofiber/storage/sqlite3
	    KeyLookup:      "header:session_id",
	    CookieDomain:   "google.com",
	    CookiePath:     "/users",
	    CookieSecure:   os.Getenv("ENVIRONMENT") == "production",
	    CookieHTTPOnly: true, // Should always be enabled
	    CookieSameSite: "Lax",
	    KeyGenerator:   utils.UUIDv4,
	}

    // create session handler
    sessions := session.New(config)

    goth_fiber.SessionStore = sessions

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. Commit your changes (git commit -am 'Add some feature')
  5. Push to the branch (git push origin my-new-feature)
  6. Create new Pull Request
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].