Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1c05b46

Browse files
authored
chore: add debug logs for OIDC responses (#6641)
1 parentffca3a5 commit1c05b46

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

‎coderd/userauth.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,20 @@ func (api *API) userOIDC(rw http.ResponseWriter, r *http.Request) {
569569
return
570570
}
571571

572+
// Log all of the field names returned in the ID token claims, and the
573+
// userinfo returned from the provider.
574+
{
575+
fields:=make([]string,0,len(claims))
576+
forf:=rangeclaims {
577+
fields=append(fields,f)
578+
}
579+
580+
api.Logger.Debug(ctx,"got oidc claims",
581+
slog.F("user_info",userInfo),
582+
slog.F("claim_fields",fields),
583+
)
584+
}
585+
572586
usernameRaw,ok:=claims[api.OIDCConfig.UsernameField]
573587
varusernamestring
574588
ifok {
@@ -624,6 +638,11 @@ func (api *API) userOIDC(rw http.ResponseWriter, r *http.Request) {
624638
// Convert the []interface{} we get to a []string.
625639
groupsInterface,ok:=groupsRaw.([]interface{})
626640
ifok {
641+
api.Logger.Debug(ctx,"groups returned in oidc claims",
642+
slog.F("len",len(groupsInterface)),
643+
slog.F("groups",groupsInterface),
644+
)
645+
627646
for_,groupInterface:=rangegroupsInterface {
628647
group,ok:=groupInterface.(string)
629648
if!ok {
@@ -634,6 +653,10 @@ func (api *API) userOIDC(rw http.ResponseWriter, r *http.Request) {
634653
}
635654
groups=append(groups,group)
636655
}
656+
}else {
657+
api.Logger.Debug(ctx,"groups field was an unknown type",
658+
slog.F("type",fmt.Sprintf("%T",groupsRaw)),
659+
)
637660
}
638661
}
639662
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp