Skip to content

chore: prevent authentication of non-unique oidc subjects #16498

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Feb 10, 2025
Merged
Changes from 1 commit
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
Prev Previous commit
add sub field to more tests
  • Loading branch information
Emyrk committed Feb 10, 2025
commit ade4eb4ceaff9f07649ffcd9a7bd448c68190d44
5 changes: 5 additions & 0 deletions coderd/userauth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1366,6 +1366,7 @@ func TestUserOIDC(t *testing.T) {

client, resp := fake.AttemptLogin(t, owner, jwt.MapClaims{
"email": user.Email,
"sub": uuid.NewString(),
})
require.Equal(t, http.StatusOK, resp.StatusCode)

Expand Down Expand Up @@ -1404,6 +1405,7 @@ func TestUserOIDC(t *testing.T) {

claims := jwt.MapClaims{
"email": userData.Email,
"sub": uuid.NewString(),
}
var err error
user.HTTPClient.Jar, err = cookiejar.New(nil)
Expand Down Expand Up @@ -1474,6 +1476,7 @@ func TestUserOIDC(t *testing.T) {

claims := jwt.MapClaims{
"email": userData.Email,
"sub": uuid.NewString(),
}
user.HTTPClient.Jar, err = cookiejar.New(nil)
require.NoError(t, err)
Expand Down Expand Up @@ -1544,6 +1547,7 @@ func TestUserOIDC(t *testing.T) {
numLogs := len(auditor.AuditLogs())
claims := jwt.MapClaims{
"email": "jon@coder.com",
"sub": uuid.NewString(),
}

userClient, _ := fake.Login(t, client, claims)
Expand Down Expand Up @@ -1664,6 +1668,7 @@ func TestUserOIDC(t *testing.T) {
claims := jwt.MapClaims{
"email": "user@example.com",
"email_verified": true,
"sub": uuid.NewString(),
}

// Perform the login
Expand Down
Loading