oakoidc

package module
v0.0.0-...-1d38b08 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package oakoidc allows logging in using Open ID Connect protocol extension over OAuth2.

Where to get credentials?

- Google:

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(withOptions ...Option) (begin, callback oakhttp.Handler, err error)

Types

type Option

type Option func(*options) error

func WithCSRFCookieName

func WithCSRFCookieName(name string) Option

func WithCallbackURL

func WithCallbackURL(URL string) Option

func WithClientID

func WithClientID(ID string) Option

func WithClientSecret

func WithClientSecret(secret string) Option

func WithDefaultOptions

func WithDefaultOptions() Option

func WithDiscoveryURL

func WithDiscoveryURL(URL string) Option

func WithScopes

func WithScopes(scopes ...string) Option

func WithSessionAdapter

func WithSessionAdapter(adapter SessionAdapter) Option

type SessionAdapter

type SessionAdapter func(
	context.Context,
	*oauth2.Token,
	*oidc.UserInfo,
) (finishURL string, err error)

type StandardClaims

type StandardClaims struct {
	Email            string `json:"email"`
	EmailVerified    bool   `json:"email_verified"`
	FamilyName       string `json:"family_name"`
	GivenName        string `json:"given_name"`
	OrganizationName string `json:"hd"`
	Locale           string `json:"locale"`
	Name             string `json:"name"`
	Picture          string `json:"picture"`
	AccountID        string `json:"sub"`
}

StandardClaims captures fields that are typically included in oidc.UserInfo claims by various OIDC providers.

https://developers.google.com/identity/openid-connect/openid-connect#an-id-tokens-payload

func NewStandardClaims

func NewStandardClaims(info *oidc.UserInfo) (*StandardClaims, error)

func (*StandardClaims) String

func (s *StandardClaims) String() string

Jump to

Keyboard shortcuts

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