@@ -22,7 +22,6 @@ import (
2222 "fmt"
2323 "net"
2424 "os"
25- "path"
2625 "time"
2726
2827 "github.com/davecgh/go-spew/spew"
@@ -71,8 +70,9 @@ type Config struct {
7170
7271 CodeChallengeMethodsSupported []string
7372
74- // CallbackURL is kube-bind specific and must match API server endpoints.
73+ // CallbackURL and IssuerURL are kube-bind specific and must match API server endpoints.
7574 CallbackURL string
75+ IssuerURL string
7676}
7777
7878var ErrServerNotRunning = fmt .Errorf ("embedded OIDC server is not running" )
@@ -86,9 +86,8 @@ func (s *Server) AddRoutes(mux *mux.Router) {
8686}
8787
8888// URL returns the base URL of the embedded OIDC server.
89- func (s * Server ) Config () (* Config , error ) {
90- spew .Dump (s .server .Config ())
91- return & Config {
89+ func (s * Server ) Config (callbackURL , issuerURL string ) (* Config , error ) {
90+ c := & Config {
9291 ClientID : s .server .Config ().ClientID ,
9392 ClientSecret : s .server .Config ().ClientSecret ,
9493 Issuer : s .server .Config ().Issuer ,
@@ -97,8 +96,11 @@ func (s *Server) Config() (*Config, error) {
9796 RefreshTTL : s .server .Config ().RefreshTTL ,
9897
9998 CodeChallengeMethodsSupported : s .server .Config ().CodeChallengeMethodsSupported ,
100- CallbackURL : path .Join (s .server .Addr (), "api/callback" ),
101- }, nil
99+ CallbackURL : callbackURL ,
100+ IssuerURL : issuerURL ,
101+ }
102+ spew .Dump (c )
103+ return c , nil
102104}
103105
104106func LoadTLSConfig (caFile string ) (* tls.Config , error ) {
0 commit comments