Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions pkg/idp/idp.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,20 @@ func (a *IDPRouter) handleRegister(c *gin.Context) {
return
}

// RFC 7591 §2: apply server-side defaults for omitted optional fields, so
// the persisted client and the registration response are spec-compliant.
// Strict clients (e.g. LM Studio's Zod schema) reject null/empty values
// here; any caller-supplied values are preserved verbatim.
if len(req.GrantTypes) == 0 {
req.GrantTypes = []string{"authorization_code"}
}
if len(req.ResponseTypes) == 0 {
req.ResponseTypes = []string{"code"}
}
if req.TokenEndpointAuthMethod == "" {
req.TokenEndpointAuthMethod = "client_secret_basic"
}

clientID, err := utils.GenerateClientID()
if err != nil {
a.logger.Error("Failed to generate client ID", zap.Error(err))
Expand Down