code: func (service *Service) SetLoggedInOauthUser(w http.ResponseWriter, r *http.Request, username /*, clientId, state*/ string) (err error) {
  	oauthSession, err := service.GetSession(r, SessionOauth, "oauthsession")
  	if err != nil {
  		log.Error(err)
  		return
  	}
  	oauthSession.Values["username"] = username
  
  	// No need to set a user cookie since we don't pass through the UI
  
  	// Clear login session
  	loginCookie := &http.Cookie{
  		Name:    "loginsession",
  		Path:    "/",
  		Value:   "",
  		Expires: time.Unix(1, 0),
  	}
  	http.SetCookie(w, loginCookie)
  
  	return
  }
docs: // SetOauthUser creates a protected session after an oauth flow and clears the login session
  // Also sets the clientID and state