Documentation
¶
Index ¶
Constants ¶
const ( AuthCodeHeader = "x-auth-code" AuthTokenHeader = "authorization" AuthTokenHeaderInternal = "id_token" AuthRefreshHeader = "x-auth-refresh" )
const (
AppleProviderURL = "https://appleid.apple.com"
)
OIDC specific provider URLs
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthHeaders ¶ added in v0.2.0
func GetAuthHeaders ¶ added in v0.1.8
func GetAuthHeaders(headers Headers) AuthHeaders
type AuthInterceptor ¶
type AuthInterceptor struct {
Providers []*Provider
}
AuthInterceptor provides various middleware that authenticate requests using the given providers.
func New ¶ added in v0.2.0
func New(providers ...*Provider) *AuthInterceptor
New returns a new AuthInterceptor that uses the given providers to authenticate requests.
func (*AuthInterceptor) GinAuthenticator ¶ added in v0.2.0
func (cb *AuthInterceptor) GinAuthenticator(ctx *gin.Context)
AuthMiddleware returns a new middleware that performs per-request auth.
func (*AuthInterceptor) UnaryServerInterceptor ¶ added in v0.2.0
func (cb *AuthInterceptor) UnaryServerInterceptor(ctx context.Context, req any, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (any, error)
UnaryServerInterceptor returns a new grpc unary server interceptor that authenticates requests using the given providers.
type Config ¶ added in v0.2.1
type Config struct {
// Client credentials
ClientID string
ClientSecret string
// Skip various checks
SkipChecks bool
// contains filtered or unexported fields
}
Config represents the configuration for an OpenID Connect provider.
type Provide ¶
type Provide interface {
Verify(ctx context.Context) (bool, error)
Redeem(ctx context.Context, code string) (context.Context, error)
Refresh(ctx context.Context) (context.Context, error)
}
Provide implements various steps of the OpenID Connect flow.
type Provider ¶
type Provider struct {
*oidc.Provider
*oidc.IDTokenVerifier
*oauth2.Config
// contains filtered or unexported fields
}
Provider represents an OpenID Connect provider, with client credentials.
func NewAppleProvider ¶ added in v0.2.0
NewAppleProvider returns a new Apple Provider.