diff --git a/pkg/apiserver/authentication/identityprovider/oidc/oidc.go b/pkg/apiserver/authentication/identityprovider/oidc/oidc.go index e22717e88..88308e2cf 100644 --- a/pkg/apiserver/authentication/identityprovider/oidc/oidc.go +++ b/pkg/apiserver/authentication/identityprovider/oidc/oidc.go @@ -19,7 +19,6 @@ package oidc import ( "context" "crypto/tls" - "encoding/base64" "encoding/json" "errors" "fmt" @@ -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 { diff --git a/pkg/apiserver/authentication/identityprovider/oidc/oidc_test.go b/pkg/apiserver/authentication/identityprovider/oidc/oidc_test.go index 20ff0175c..2f351de5f 100644 --- a/pkg/apiserver/authentication/identityprovider/oidc/oidc_test.go +++ b/pkg/apiserver/authentication/identityprovider/oidc/oidc_test.go @@ -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")) })