feat(authn-oidc): use full urls for login callback/logout options

This commit is contained in:
2024-05-23 15:17:05 +02:00
parent 499bb3696d
commit 544326a4b7
11 changed files with 270 additions and 62 deletions

View File

@ -2,6 +2,7 @@ package oidc
import (
"context"
"net/http"
"github.com/coreos/go-oidc/v3/oidc"
)
@ -14,6 +15,7 @@ type ClientOptions struct {
Scopes []string
AuthParams map[string]string
SkipIssuerCheck bool
HTTPClient *http.Client
}
type ClientOptionFunc func(*ClientOptions)
@ -63,9 +65,16 @@ func WithProvider(provider *oidc.Provider) ClientOptionFunc {
}
}
func WithHTTPClient(client *http.Client) ClientOptionFunc {
return func(opt *ClientOptions) {
opt.HTTPClient = client
}
}
func NewClientOptions(funcs ...ClientOptionFunc) *ClientOptions {
opt := &ClientOptions{
Scopes: []string{oidc.ScopeOpenID, "profile"},
Scopes: []string{oidc.ScopeOpenID, "profile"},
HTTPClient: http.DefaultClient,
}
for _, f := range funcs {