mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2026-03-05 14:22:05 +00:00
Compare commits
2 Commits
v5.0.1-bet
...
feat/oidc-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dbc7b10254 | ||
|
|
ec8121499c |
@@ -59,7 +59,7 @@ func (controller *WellKnownController) OpenIDConnectConfiguration(c *gin.Context
|
|||||||
SubjectTypesSupported: []string{"pairwise"},
|
SubjectTypesSupported: []string{"pairwise"},
|
||||||
IDTokenSigningAlgValuesSupported: []string{"RS256"},
|
IDTokenSigningAlgValuesSupported: []string{"RS256"},
|
||||||
TokenEndpointAuthMethodsSupported: []string{"client_secret_basic", "client_secret_post"},
|
TokenEndpointAuthMethodsSupported: []string{"client_secret_basic", "client_secret_post"},
|
||||||
ClaimsSupported: []string{"sub", "updated_at", "name", "preferred_username", "email", "email_verified", "groups"},
|
ClaimsSupported: []string{"sub", "updated_at", "name", "preferred_username", "email", "groups"},
|
||||||
ServiceDocumentation: "https://tinyauth.app/docs/guides/oidc",
|
ServiceDocumentation: "https://tinyauth.app/docs/guides/oidc",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,6 @@ type ClaimSet struct {
|
|||||||
Exp int64 `json:"exp"`
|
Exp int64 `json:"exp"`
|
||||||
Name string `json:"name,omitempty"`
|
Name string `json:"name,omitempty"`
|
||||||
Email string `json:"email,omitempty"`
|
Email string `json:"email,omitempty"`
|
||||||
EmailVerified bool `json:"email_verified,omitempty"`
|
|
||||||
PreferredUsername string `json:"preferred_username,omitempty"`
|
PreferredUsername string `json:"preferred_username,omitempty"`
|
||||||
Groups []string `json:"groups,omitempty"`
|
Groups []string `json:"groups,omitempty"`
|
||||||
Nonce string `json:"nonce,omitempty"`
|
Nonce string `json:"nonce,omitempty"`
|
||||||
@@ -61,7 +60,6 @@ type UserinfoResponse struct {
|
|||||||
Email string `json:"email,omitempty"`
|
Email string `json:"email,omitempty"`
|
||||||
PreferredUsername string `json:"preferred_username,omitempty"`
|
PreferredUsername string `json:"preferred_username,omitempty"`
|
||||||
Groups []string `json:"groups,omitempty"`
|
Groups []string `json:"groups,omitempty"`
|
||||||
EmailVerified bool `json:"email_verified,omitempty"`
|
|
||||||
UpdatedAt int64 `json:"updated_at"`
|
UpdatedAt int64 `json:"updated_at"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -390,7 +388,6 @@ func (service *OIDCService) generateIDToken(client config.OIDCClientConfig, user
|
|||||||
Exp: expiresAt,
|
Exp: expiresAt,
|
||||||
Name: userInfo.Name,
|
Name: userInfo.Name,
|
||||||
Email: userInfo.Email,
|
Email: userInfo.Email,
|
||||||
EmailVerified: userInfo.EmailVerified,
|
|
||||||
PreferredUsername: userInfo.PreferredUsername,
|
PreferredUsername: userInfo.PreferredUsername,
|
||||||
Groups: userInfo.Groups,
|
Groups: userInfo.Groups,
|
||||||
Nonce: nonce,
|
Nonce: nonce,
|
||||||
@@ -586,8 +583,6 @@ func (service *OIDCService) CompileUserinfo(user repository.OidcUserinfo, scope
|
|||||||
|
|
||||||
if slices.Contains(scopes, "email") {
|
if slices.Contains(scopes, "email") {
|
||||||
userInfo.Email = user.Email
|
userInfo.Email = user.Email
|
||||||
// We can set this as a configuration option in the future but for now it's a good idea to assume it's true
|
|
||||||
userInfo.EmailVerified = true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if slices.Contains(scopes, "groups") {
|
if slices.Contains(scopes, "groups") {
|
||||||
|
|||||||
Reference in New Issue
Block a user