From 63bcf069b6a856edd2bc27170a50520a2ee0b672 Mon Sep 17 00:00:00 2001 From: Martin Angers Date: Thu, 31 Oct 2019 21:56:29 -0400 Subject: [PATCH] attempt to figure out auth --- auth0.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/auth0.go b/auth0.go index 6a3c14e..8472490 100644 --- a/auth0.go +++ b/auth0.go @@ -88,7 +88,7 @@ func New(ctx context.Context, conf *Config) (*Endpoints, error) { ClientSecret: conf.ClientSecret, RedirectURL: conf.OauthCallbackURL, Endpoint: provider.Endpoint(), - Scopes: []string{oidc.ScopeOpenID, "profile"}, // TODO: what is this profile? + Scopes: []string{oidc.ScopeOpenID, "profile", "email"}, } return &Endpoints{ @@ -139,6 +139,8 @@ func (e *Endpoints) Logout(w http.ResponseWriter, r *http.Request) { params.Add("client_id", e.oauthConfig.ClientID) lurl.RawQuery = params.Encode() + // TODO: clear session cookie + http.Redirect(w, r, lurl.String(), http.StatusTemporaryRedirect) } @@ -190,9 +192,9 @@ func (e *Endpoints) LoginCallback(w http.ResponseWriter, r *http.Request) { // TODO: debugging info, print out whatever we received b, _ := json.MarshalIndent(idToken, "", " ") - fmt.Println(string(b)) + fmt.Println("id token content: >>>>>> \n", string(b)) b, _ = json.MarshalIndent(profile, "", " ") - fmt.Println(string(b)) + fmt.Println("token claims: >>>>>>> \n", string(b)) // TODO: save session (but what info?) -- 2.38.5