diff --git a/options/options.go b/options/options.go index 6a8add1..ca64575 100644 --- a/options/options.go +++ b/options/options.go @@ -45,6 +45,7 @@ type Options struct { TokenString [][]TokenStringOption ClaimsContextKeyName ClaimsContextKeyName ErrorHandler ErrorHandler + Permissive bool } // New takes Option setters and returns an Options pointer. @@ -262,3 +263,10 @@ func WithErrorHandler(opt ErrorHandler) Option { opts.ErrorHandler = opt } } + +// WithPermissive allows incoming requests to pass even if the client does not provide a token. +func WithPermissive(opt bool) Option { + return func(opts *Options) { + opts.Permissive = opt + } +}