mirror of
https://github.com/coder/coder.git
synced 2025-07-09 11:45:56 +00:00
chore: prevent authentication of non-unique oidc subjects (#16498)
Any IdP returning an empty field here breaks the assumption of a unique subject id. This is defined in the OIDC spec.
This commit is contained in:
@ -10,6 +10,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/golang-jwt/jwt/v4"
|
||||
"github.com/google/uuid"
|
||||
"github.com/imulab/go-scim/pkg/v2/handlerutil"
|
||||
"github.com/imulab/go-scim/pkg/v2/spec"
|
||||
"github.com/stretchr/testify/assert"
|
||||
@ -568,6 +569,7 @@ func TestScim(t *testing.T) {
|
||||
//nolint:bodyclose
|
||||
scimUserClient, _ := fake.Login(t, client, jwt.MapClaims{
|
||||
"email": sUser.Emails[0].Value,
|
||||
"sub": uuid.NewString(),
|
||||
})
|
||||
scimUser, err = scimUserClient.User(ctx, codersdk.Me)
|
||||
require.NoError(t, err)
|
||||
@ -836,6 +838,7 @@ func TestScim(t *testing.T) {
|
||||
//nolint:bodyclose
|
||||
scimUserClient, _ := fake.Login(t, client, jwt.MapClaims{
|
||||
"email": sUser.Emails[0].Value,
|
||||
"sub": uuid.NewString(),
|
||||
})
|
||||
scimUser, err = scimUserClient.User(ctx, codersdk.Me)
|
||||
require.NoError(t, err)
|
||||
|
Reference in New Issue
Block a user