From ee72eb00c7af5ad9f1a811b5958f6c6c24765801 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20M=C3=B6hlmann?= Date: Fri, 18 Aug 2023 17:39:03 +0200 Subject: [PATCH] undo example testing changes --- example/server/dynamic/op.go | 6 +++--- example/server/exampleop/op.go | 2 +- example/server/main.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/example/server/dynamic/op.go b/example/server/dynamic/op.go index d63c528..783c75c 100644 --- a/example/server/dynamic/op.go +++ b/example/server/dynamic/op.go @@ -40,7 +40,7 @@ func main() { port := "9998" issuers := make([]string, len(hostnames)) for i, hostname := range hostnames { - issuers[i] = fmt.Sprintf("http://%s:%s/oidc/", hostname, port) + issuers[i] = fmt.Sprintf("http://%s:%s/", hostname, port) } //the OpenID Provider requires a 32-byte key for (token) encryption @@ -84,7 +84,7 @@ func main() { //if your issuer ends with a path (e.g. http://localhost:9998/custom/path/), //then you would have to set the path prefix (/custom/path/): //router.PathPrefix("/custom/path/").Handler(http.StripPrefix("/custom/path", provider.HttpHandler())) - router.PathPrefix("/oidc/").Handler(http.StripPrefix("/oidc", provider.HttpHandler())) + router.PathPrefix("/").Handler(provider.HttpHandler()) server := &http.Server{ Addr: ":" + port, @@ -125,7 +125,7 @@ func newDynamicOP(ctx context.Context, storage op.Storage, key [32]byte) (*op.Pr //this example has only static texts (in English), so we'll set the here accordingly SupportedUILocales: []language.Tag{language.English}, } - handler, err := op.NewDynamicOpenIDProvider("/oidc/", config, storage, + handler, err := op.NewDynamicOpenIDProvider("/", config, storage, //we must explicitly allow the use of the http issuer op.WithAllowInsecure(), //as an example on how to customize an endpoint this will change the authorization_endpoint from /authorize to /auth diff --git a/example/server/exampleop/op.go b/example/server/exampleop/op.go index cc946c7..20190ca 100644 --- a/example/server/exampleop/op.go +++ b/example/server/exampleop/op.go @@ -72,7 +72,7 @@ func SetupServer(issuer string, storage Storage, extraOptions ...op.Option) *mux // // if your issuer ends with a path (e.g. http://localhost:9998/custom/path/), // then you would have to set the path prefix (/custom/path/) - router.PathPrefix("/oidc/").Handler(http.StripPrefix("/oidc", provider.HttpHandler())) + router.PathPrefix("/").Handler(provider.HttpHandler()) return router } diff --git a/example/server/main.go b/example/server/main.go index e4555ad..a2836ea 100644 --- a/example/server/main.go +++ b/example/server/main.go @@ -13,7 +13,7 @@ func main() { //we will run on :9998 port := "9998" //which gives us the issuer: http://localhost:9998/ - issuer := fmt.Sprintf("http://localhost:%s/oidc/", port) + issuer := fmt.Sprintf("http://localhost:%s/", port) // the OpenIDProvider interface needs a Storage interface handling various checks and state manipulations // this might be the layer for accessing your database