Version: v0.2.1 Latest Latest

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

Go to latest
Published: Mar 31, 2020 License: MIT Imports: 5 Imported by: 0


Space / OAuth 2 provider

A user management microservice; OAuth 2 provider


Please take a look at /issues


MIT License © Ewerton Assis




View Source
const (

	// InvalidRequest error type
	InvalidRequest string = "invalid_request"
	// UnauthorizedClient error type
	UnauthorizedClient string = "unauthorized_client"
	// AccessDenied error type
	AccessDenied string = "access_denied"
	// UnsupportedResponseType error type
	UnsupportedResponseType string = "unsupported_response_type"
	// InvalidScope error type
	InvalidScope string = "invalid_scope"
	// ServerError error type
	ServerError string = "server_error"
	// TemporarilyUnavailable error type
	TemporarilyUnavailable string = "temporarily_unavailable"
	// UnsupportedGrantType error type
	UnsupportedGrantType string = "unsupported_grant_type"
	// InvalidGrant error type
	InvalidGrant string = "invalid_grant"
	// InvalidSession error type
	InvalidSession string = "invalid_session"
	// InvalidRedirectURI error type
	InvalidRedirectURI string = "invalid_redirect_uri"

	// AuthorizationCode grant type
	AuthorizationCode string = "authorization_code"
	// RefreshToken grant type
	RefreshToken string = "refresh_token"
	// Password grant type
	Password string = "password"
	// ClientCredentials grant type
	ClientCredentials string = "client_credentials"

	// Code response type
	Code string = "code"
	// Token response type
	Token string = "token"


This section is empty.


func AccessAuthentication

func AccessAuthentication(token string) models.Session

AccessAuthentication obtains a Session entry (typed as an `Access Token`) through

its token string

func AccessTokenRequest

func AccessTokenRequest(data utils.H) (utils.H, error)

AccessTokenRequest returns OAuth 2 access and refresh tokens, given the right details:

basically, a `code` from `AuthorizationCodeGrant`

func AuthorizationCodeGrant

func AuthorizationCodeGrant(data utils.H) (utils.H, error)

AuthorizationCodeGrant returns an OAuth 2 authorization code grant, given the right details

func ClientAuthentication

func ClientAuthentication(authorizationHeader string) models.Client

ClientAuthentication authenticates a client application, extracting the key-secret pair;

and returns a client entry/model, given the key-secret pair

func RefreshTokenRequest

func RefreshTokenRequest(data utils.H) (utils.H, error)

RefreshTokenRequest returns OAuth 2 access and refresh tokens, given the right details:

basically, a `refresh token` from `AccessTokenRequest`


This section is empty.

Jump to

Keyboard shortcuts

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