Documentation ¶
Overview ¶
Package oakoidc allows logging in using Open ID Connect protocol extension over OAuth2.
Where to get credentials?
- Google:
- <https://console.cloud.google.com/apis/credentials>
- OPENID_CONNECT_DISCOVERY_URL=https://accounts.google.com
Index ¶
- func New(withOptions ...Option) (begin, callback oakhttp.Handler, err error)
- type Option
- func WithCSRFCookieName(name string) Option
- func WithCallbackURL(URL string) Option
- func WithClientID(ID string) Option
- func WithClientSecret(secret string) Option
- func WithDefaultOptions() Option
- func WithDiscoveryURL(URL string) Option
- func WithScopes(scopes ...string) Option
- func WithSessionAdapter(adapter SessionAdapter) Option
- type SessionAdapter
- type StandardClaims
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option func(*options) error
func WithCSRFCookieName ¶
func WithCallbackURL ¶
func WithClientID ¶
func WithClientSecret ¶
func WithDefaultOptions ¶
func WithDefaultOptions() Option
func WithDiscoveryURL ¶
func WithScopes ¶
func WithSessionAdapter ¶
func WithSessionAdapter(adapter SessionAdapter) Option
type SessionAdapter ¶
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
Click to show internal directories.
Click to hide internal directories.