feat: forward sub from oidc providers

This commit is contained in:
Stavros
2025-12-26 18:28:53 +02:00
parent 2d8af0510e
commit eef674a4e6
12 changed files with 21 additions and 0 deletions

View File

@@ -22,6 +22,7 @@ var GoogleOAuthScopes = []string{"https://www.googleapis.com/auth/userinfo.email
type GoogleUserInfoResponse struct {
Email string `json:"email"`
Name string `json:"name"`
Id string `json:"id"`
}
type GoogleOAuthService struct {
@@ -117,6 +118,9 @@ func (google *GoogleOAuthService) Userinfo() (config.Claims, error) {
user.Name = userInfo.Name
user.Email = userInfo.Email
// We can use the id as the sub
user.Sub = userInfo.Id
return user, nil
}