From 199b685f430910910e43476caa9ccec6a441d020 Mon Sep 17 00:00:00 2001 From: Dominik Süß Date: Tue, 6 Dec 2022 14:15:56 +0100 Subject: [feature] overhaul the oidc system (#961) * [feature] overhaul the oidc system this allows for more flexible username handling and prevents account takeover using old email addresses * [feature] add migration path for old OIDC users * [feature] nicer error reporting for users * [docs] document the new OIDC flow * [fix] return early on oidc error * [docs]: add comments on the finalization logic --- internal/oidc/claims.go | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'internal/oidc/claims.go') diff --git a/internal/oidc/claims.go b/internal/oidc/claims.go index 4ff337cfb..6f0e58ca9 100644 --- a/internal/oidc/claims.go +++ b/internal/oidc/claims.go @@ -18,10 +18,18 @@ package oidc +import "encoding/gob" + // Claims represents claims as found in an id_token returned from an OIDC flow. type Claims struct { - Email string `json:"email"` - EmailVerified bool `json:"email_verified"` - Groups []string `json:"groups"` - Name string `json:"name"` + Sub string `json:"sub"` + Email string `json:"email"` + EmailVerified bool `json:"email_verified"` + Groups []string `json:"groups"` + Name string `json:"name"` + PreferredUsername string `json:"preferred_username"` +} + +func init() { + gob.Register(&Claims{}) } -- cgit v1.2.3