Documentation ¶
Index ¶
- Constants
- Variables
- type AuthCodeOptioner
- 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
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 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 { TokenSource() oauth2.TokenSource AccessTokenClaims(into interface{}) error }
Identity defines a TokenSource which is can be used to get an AccessToken vor OAuth2 flows