Skip to content

Commit

Permalink
Revert PR #5018 (#5548)
Browse files Browse the repository at this point in the history
Revert "[KS-OIDC] Remove special characters form sub OIDC standard claim (#5018)"

This reverts commit 45a0625.
  • Loading branch information
zhou1203 committed Feb 27, 2023
1 parent a8ac54f commit 9dad732
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions pkg/apiserver/authentication/identityprovider/oidc/oidc.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package oidc
import (
"context"
"crypto/tls"
"encoding/base64"
"encoding/json"
"errors"
"fmt"
Expand Down Expand Up @@ -116,7 +115,7 @@ type oidcIdentity struct {
}

func (o oidcIdentity) GetUserID() string {
return base64.RawURLEncoding.EncodeToString([]byte(o.Sub))
return o.Sub
}

func (o oidcIdentity) GetUsername() string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ var _ = Describe("OIDC", func() {
req := &http.Request{URL: url}
identity, err := provider.IdentityExchangeCallback(req)
Expect(err).Should(BeNil())
Expect(identity.GetUserID()).Should(Equal(base64.RawURLEncoding.EncodeToString([]byte("110169484474386276334"))))
Expect(identity.GetUserID()).Should(Equal("110169484474386276334"))
Expect(identity.GetUsername()).Should(Equal("test"))
Expect(identity.GetEmail()).Should(Equal("test@kubesphere.io"))
})
Expand Down

0 comments on commit 9dad732

Please sign in to comment.