feat: forward sub from oidc providers (#543)

* feat: forward sub from oidc providers

* fix: review comments
This commit is contained in:
Stavros
2025-12-26 19:02:51 +02:00
committed by GitHub
parent 2d8af0510e
commit 43487d44f7
12 changed files with 21 additions and 13 deletions

View File

@@ -9,6 +9,7 @@ import (
"fmt"
"io"
"net/http"
"strconv"
"time"
"github.com/steveiliop56/tinyauth/internal/config"
@@ -27,6 +28,7 @@ type GithubEmailResponse []struct {
type GithubUserInfoResponse struct {
Login string `json:"login"`
Name string `json:"name"`
ID int `json:"id"`
}
type GithubOAuthService struct {
@@ -172,6 +174,7 @@ func (github *GithubOAuthService) Userinfo() (config.Claims, error) {
user.PreferredUsername = userInfo.Login
user.Name = userInfo.Name
user.Sub = strconv.Itoa(userInfo.ID)
return user, nil
}