From f5d0e64ff1e1b7dbbdbe844bc8113021aaf215bc Mon Sep 17 00:00:00 2001 From: Livio Amstutz Date: Tue, 24 Nov 2020 15:56:12 +0100 Subject: [PATCH] chore(example): dynamic scopes in example (#72) --- example/client/app/app.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/example/client/app/app.go b/example/client/app/app.go index 1c9c469..ad00adb 100644 --- a/example/client/app/app.go +++ b/example/client/app/app.go @@ -8,6 +8,7 @@ import ( "io/ioutil" "net/http" "os" + "strings" "time" "github.com/google/uuid" @@ -28,11 +29,11 @@ func main() { clientSecret := os.Getenv("CLIENT_SECRET") issuer := os.Getenv("ISSUER") port := os.Getenv("PORT") + scopes := strings.Split(os.Getenv("SCOPES"), " ") ctx := context.Background() redirectURI := fmt.Sprintf("http://localhost:%v%v", port, callbackPath) - scopes := []string{oidc.ScopeOpenID, oidc.ScopeProfile, oidc.ScopeEmail, oidc.ScopeAddress} cookieHandler := utils.NewCookieHandler(key, key, utils.WithUnsecure()) provider, err := rp.NewRelayingPartyOIDC(issuer, clientID, clientSecret, redirectURI, scopes, rp.WithPKCE(cookieHandler),