oidc

package
v0.0.0-...-698e2ea Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NonceCookie    = "NONCE"
	JWTCookie      = "JWT"
	RedirectCookie = "REDIRECT"
	JWTHeader      = "X-JWT"
	StateStringFmt = "%v|%v"
)

Variables

This section is empty.

Functions

func NewOIDCAuth

func NewOIDCAuth(clientID, clientSecret, redirectURL string) oidcAuthBuilder

Types

type IDToken

type IDToken = oidc.IDToken

type OIDCAuth

type OIDCAuth struct {
	// contains filtered or unexported fields
}

func (OIDCAuth) HandleCallBack

func (o OIDCAuth) HandleCallBack(w http.ResponseWriter, r *http.Request)

HandleCallBack uses cookie to rebuild secret state variable to validate user has been authed

func (OIDCAuth) HandleRedirect

func (o OIDCAuth) HandleRedirect(w http.ResponseWriter, r *http.Request)

HandleRedirect creates a session nonce, encrypts it in a cookie, builds a secret state and redirects user to auth service

func (OIDCAuth) Verify

func (o OIDCAuth) Verify(ctx context.Context, rawIDToken string) (*IDToken, error)

Jump to

Keyboard shortcuts

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