(c *gin.Context, sub string, userContext config.UserContext, req AuthorizeRequest)
| 342 | } |
| 343 | |
| 344 | func (service *OIDCService) StoreUserinfo(c *gin.Context, sub string, userContext config.UserContext, req AuthorizeRequest) error { |
| 345 | userInfoParams := repository.CreateOidcUserInfoParams{ |
| 346 | Sub: sub, |
| 347 | Name: userContext.Name, |
| 348 | Email: userContext.Email, |
| 349 | PreferredUsername: userContext.Username, |
| 350 | UpdatedAt: time.Now().Unix(), |
| 351 | } |
| 352 | |
| 353 | // Tinyauth will pass through the groups it got from an LDAP or an OIDC server |
| 354 | if userContext.Provider == "ldap" { |
| 355 | userInfoParams.Groups = userContext.LdapGroups |
| 356 | } |
| 357 | |
| 358 | if userContext.OAuth && len(userContext.OAuthGroups) > 0 { |
| 359 | userInfoParams.Groups = userContext.OAuthGroups |
| 360 | } |
| 361 | |
| 362 | _, err := service.queries.CreateOidcUserInfo(c, userInfoParams) |
| 363 | |
| 364 | return err |
| 365 | } |
| 366 | |
| 367 | func (service *OIDCService) ValidateGrantType(grantType string) error { |
| 368 | if !slices.Contains(SupportedGrantTypes, grantType) { |
no test coverage detected