Documentation ¶
Index ¶
- Constants
- Variables
- type AuthCodeOptioner
- type CallbackErrorHandler
- type ClaimSet
- func (c *ClaimSet) AddClaimWithValue(topLevelName string, claimName string, essential bool, value string)
- func (c *ClaimSet) AddClaimWithValues(topLevelName string, claimName string, essential bool, values ...string)
- func (c *ClaimSet) AddVoluntaryClaim(topLevelName string, claimName string)
- func (c *ClaimSet) AuthCodeOption() (oauth2.AuthCodeOption, error)
- func (c *ClaimSet) HasClaims() bool
- type Identity
- type Module
- type OpenIDIdentity
- type StateEntry
Constants ¶
const ( TopLevelClaimUserInfo = "userinfo" TopLevelClaimIDToken = "id_token" )
JSON keys for top-level member of the Claims request JSON.
Variables ¶
var ( // OAuthTypeChecker checks the Identity for OAuth Identity OAuthTypeChecker = func(identity auth.Identity) bool { _, ok := identity.(Identity) return ok } )
var ( // OpenIDTypeChecker checks the Identity for OpenID Identity OpenIDTypeChecker = func(identity auth.Identity) bool { _, ok := identity.(OpenIDIdentity) return ok } )
Functions ¶
This section is empty.
Types ¶
type AuthCodeOptioner ¶
type AuthCodeOptioner interface {
Options(ctx context.Context, broker string, request *web.Request) []oauth2.AuthCodeOption
}
AuthCodeOptioner returns an oauth2.AuthCodeOption for the broker
type CallbackErrorHandler ¶ added in v3.5.0
type CallbackErrorHandler interface {
Handle(ctx context.Context, broker string, request *web.Request, originalReturnTo func(request *web.Request) *url.URL, errString string, errDetails string) web.Result
}
CallbackErrorHandler can be used to handle errors in the Callback e.g. to cover prompt=none cases
type ClaimSet ¶
type ClaimSet struct {
// contains filtered or unexported fields
}
ClaimSet contains map with members of the Claims request. It provides methods to add specific Claims.
func (*ClaimSet) AddClaimWithValue ¶
func (c *ClaimSet) AddClaimWithValue(topLevelName string, claimName string, essential bool, value string)
AddClaimWithValue adds the Claim being requested to return a particular value. The Claim can be defined as an Essential Claim.
func (*ClaimSet) AddClaimWithValues ¶
func (c *ClaimSet) AddClaimWithValues(topLevelName string, claimName string, essential bool, values ...string)
AddClaimWithValues adds the Claim being requested to return one of a set of values, with the values appearing in order of preference. The Claim can be defined as an Essential Claim.
func (*ClaimSet) AddVoluntaryClaim ¶
AddVoluntaryClaim adds the Claim being requested in default manner, as a Voluntary Claim.
func (*ClaimSet) AuthCodeOption ¶
func (c *ClaimSet) AuthCodeOption() (oauth2.AuthCodeOption, error)
AuthCodeOption returns oauth2.AuthCodeOption with json encoded body containing all defined claims. It returns error in case when json marshalling can not be performed.
type Identity ¶
type Identity interface { auth.Identity TokenSource() oauth2.TokenSource AccessTokenClaims(into interface{}) error }
Identity defines a TokenSource which is can be used to get an AccessToken vor OAuth2 flows
type Module ¶
type Module struct{}
Module provides OpenID Connect support
type OpenIDIdentity ¶
type OpenIDIdentity interface { auth.Identity Identity IDToken() *oidc.IDToken IDTokenClaims(into interface{}) error }
OpenIDIdentity is an extension of Identity which provides an IDToken on top of OAuth2
type StateEntry ¶ added in v3.4.0
StateEntry stores entries of recent states during login (oidc states)