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

Commita49b491

Browse files
committed
Add test case for username as email
1 parent424579e commita49b491

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

‎coderd/coderd_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ func TestAuthorizeAllEndpoints(t *testing.T) {
248248

249249
// Has it's own auth
250250
"GET:/api/v2/users/oauth2/github/callback": {NoAuthorize:true},
251+
"GET:/api/v2/users/oidc/callback": {NoAuthorize:true},
251252

252253
// All workspaceagents endpoints do not use rbac
253254
"POST:/api/v2/workspaceagents/aws-instance-identity": {NoAuthorize:true},

‎coderd/userauth_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,18 @@ func TestUserOIDC(t *testing.T) {
319319
Username:"hotdog",
320320
AllowSignups:true,
321321
StatusCode:http.StatusTemporaryRedirect,
322+
}, {
323+
// Services like Okta return the email as the username:
324+
// https://developer.okta.com/docs/reference/api/oidc/#base-claims-always-present
325+
Name:"UsernameAsEmail",
326+
Claims: jwt.MapClaims{
327+
"email":"kyle@kwc.io",
328+
"email_verified":true,
329+
"preferred_username":"kyle@kwc.io",
330+
},
331+
Username:"kyle",
332+
AllowSignups:true,
333+
StatusCode:http.StatusTemporaryRedirect,
322334
}} {
323335
tc:=tc
324336
t.Run(tc.Name,func(t*testing.T) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp