Popularity
0.9
Declining
Activity
0.0
Stable
3
3
0
Description
This is a ported project from OAuth2 Provider that had been written in Node.js with some additional features.
Programming language: Go
License: GNU General Public License v3.0 or later
Latest version: v0.2.4
go-oauth2 alternatives and similar packages
Based on the "Authentication & OAuth" category.
Alternatively, view go-oauth2 alternatives based on common mentions on social networks and blogs.
-
oauth2
Successor of goauth2. Generic OAuth 2.0 package that comes with JWT, Google APIs, Compute Engine and App Engine support. -
goth
provides a simple, clean, and idiomatic way to use OAuth and OAuth2. Handles multiple provides out of the box. -
authboss
A modular authentication system for the web. It tries to remove as much boilerplate and "hard things" as possible so that each time you start a new web project in Go, you can plug it in, configure, and start building your app without having to build an authentication system each time. -
go-jose
A fairly complete implementation of the JOSE working group's JSON Web Token, JSON Web Signatures, and JSON Web Encryption specs. -
permissions2
Library for keeping track of users, login states and permissions. Uses secure cookies and bcrypt. -
yubigo
a Yubikey client package that provides a simple API to integrate the Yubico Yubikey into a go application. -
sessions
A dead simple, highly performant, highly customizable sessions service for go http servers. -
Facecontrol
Simple yet powerful authentication, single sign-on and (optinal) authorization solution.
Get performance insights in less than 4 minutes
Scout APM uses tracing logic that ties bottlenecks to source code so you know the exact line of code causing performance issues and can get back to building a great product faster.
Sponsored
scoutapm.com
Do you think we are missing an alternative of go-oauth2 or a related project?
README
go-oauth2
OAuth2 Provider library written in Go
This is a ported project from OAuth2 Provider that had been written in Node.js with some additional features.
- Pure implementation in GoLang.
- Current implementation only supports password_flow & refresh_token_flow.
- Use JWT.
- Default buildin with MongoDB.
- Allow to customize the server.
Example Server
package main
import (
"fmt"
"github.com/phuc0302/go-oauth2"
"github.com/phuc0302/go-oauth2/oauth_key"
"github.com/phuc0302/go-oauth2/oauth_role"
"github.com/phuc0302/go-server"
"github.com/phuc0302/go-server/util"
)
func main() {
// Initialize server with sandbox mode enable and using MongoDB.
oauth2.InitializeWithMongoDB(true, true)
// Define handler
f := func(c *server.RequestContext) {
if s, ok := c.GetExtra(oauthKey.Context).(oauth2.OAuthContext); ok {
c.OutputText(util.Status200(), fmt.Sprintf("Hello, your ID is: %s", s.User.UserID()))
} else {
panic(util.Status401())
}
}
// Bind handler with HTTP GET
oauth2.BindGet("/protected", oauthRole.All(), f)
// Start server
oauth2.Run()
}
Author
Phuc, Tran Huu [email protected]