@@ -22,9 +22,9 @@ import (
2222 "fmt"
2323 "net"
2424 "os"
25- "path"
2625 "time"
2726
27+ "github.com/davecgh/go-spew/spew"
2828 "github.com/gorilla/mux"
2929 "github.com/xrstf/mockoidc"
3030)
@@ -70,8 +70,9 @@ type Config struct {
7070
7171 CodeChallengeMethodsSupported []string
7272
73- // 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.
7474 CallbackURL string
75+ IssuerURL string
7576}
7677
7778var ErrServerNotRunning = fmt .Errorf ("embedded OIDC server is not running" )
@@ -85,8 +86,8 @@ func (s *Server) AddRoutes(mux *mux.Router) {
8586}
8687
8788// URL returns the base URL of the embedded OIDC server.
88- func (s * Server ) Config () (* Config , error ) {
89- return & Config {
89+ func (s * Server ) Config (callbackURL , issuerURL string ) (* Config , error ) {
90+ c := & Config {
9091 ClientID : s .server .Config ().ClientID ,
9192 ClientSecret : s .server .Config ().ClientSecret ,
9293 Issuer : s .server .Config ().Issuer ,
@@ -95,8 +96,11 @@ func (s *Server) Config() (*Config, error) {
9596 RefreshTTL : s .server .Config ().RefreshTTL ,
9697
9798 CodeChallengeMethodsSupported : s .server .Config ().CodeChallengeMethodsSupported ,
98- CallbackURL : path .Join (s .server .Addr (), "api/callback" ),
99- }, nil
99+ CallbackURL : callbackURL ,
100+ IssuerURL : issuerURL ,
101+ }
102+ spew .Dump (c )
103+ return c , nil
100104}
101105
102106func LoadTLSConfig (caFile string ) (* tls.Config , error ) {
0 commit comments