auth

package module
v0.0.0-...-eebac63 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: MIT Imports: 11 Imported by: 0

README

auth

OAuth2 authentication service

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Auth

func Auth(w http.ResponseWriter, r *http.Request)

Auth implements the Google Cloud Functions entrypoint.

func Error500f

func Error500f(w http.ResponseWriter, format string, a ...interface{})

Error500f creates an HTTP 500 error response.

func Errorf

func Errorf(w http.ResponseWriter, oauthError OAuthError,
	format string, a ...interface{})

Errorf creates an HTTP error response.

func Fatalf

func Fatalf(format string, a ...interface{})

Fatalf reports a fatal error and exits the process.

func Token

func Token(w http.ResponseWriter, r *http.Request)

Token implements the "/token" URI handler.

Types

type OAuthError

type OAuthError string

OAuthError defines OAuth2 errors

const (
	ErrorInvalidRequest       OAuthError = "invalid_request"
	ErrorInvalidClient        OAuthError = "invalid_client"
	ErrorInvalidGrant         OAuthError = "invalid_grant"
	ErrorUnauthorizedClient   OAuthError = "unauthorized_client"
	ErrorUnsupportedGrantType OAuthError = "unsupported_grant_type"
	ErrorInvalidScope         OAuthError = "invalid_scope"
)

OAuth2 errors

Directories

Path Synopsis
apps
cmd

Jump to

Keyboard shortcuts

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