@@ 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?)