mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Merge pull request #7753 from swordqiu/hotfix/qj-remove-sso-redundant-authcookie
fix: remove redundant auth cookie in sso login
This commit is contained in:
@@ -28,7 +28,6 @@ import (
|
||||
"yunion.io/x/pkg/errors"
|
||||
"yunion.io/x/pkg/utils"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/apigateway/constants"
|
||||
"yunion.io/x/onecloud/pkg/apigateway/options"
|
||||
api "yunion.io/x/onecloud/pkg/apis/identity"
|
||||
"yunion.io/x/onecloud/pkg/appctx"
|
||||
@@ -76,14 +75,14 @@ func (h *AuthHandlers) getIdpSsoRedirectUri(ctx context.Context, w http.Response
|
||||
query, _ := jsonutils.ParseQueryString(req.URL.RawQuery)
|
||||
var linkuser string
|
||||
if query != nil && query.Contains("linkuser") {
|
||||
t, authToken, _ := fetchAuthInfo(ctx, req)
|
||||
t, _, _ := fetchAuthInfo(ctx, req)
|
||||
if t == nil {
|
||||
httperrors.InvalidCredentialError(ctx, w, "invalid credential")
|
||||
return
|
||||
}
|
||||
linkuser = t.GetUserId()
|
||||
authCookie := authToken.GetAuthCookie(t)
|
||||
saveCookie(w, constants.YUNION_AUTH_COOKIE, authCookie, "", expires, true)
|
||||
// authCookie := authToken.GetAuthCookie(t)
|
||||
// saveCookie(w, constants.YUNION_AUTH_COOKIE, authCookie, "", expires, true)
|
||||
}
|
||||
|
||||
referer := req.Header.Get(http.CanonicalHeaderKey("referer"))
|
||||
|
||||
@@ -292,7 +292,7 @@ func handleOIDCConfiguration(ctx context.Context, w http.ResponseWriter, req *ht
|
||||
userinfoUrl := httputils.JoinPath(options.Options.ApiServer, "api/v1/auth/oidc/user")
|
||||
jwksUrl := httputils.JoinPath(options.Options.ApiServer, "api/v1/auth/oidc/keys")
|
||||
conf := oidcutils.SOIDCConfiguration{
|
||||
Issuer: options.Options.ApiServer,
|
||||
Issuer: httputils.JoinPath(options.Options.ApiServer, "api/v1/auth/oidc"),
|
||||
AuthorizationEndpoint: authUrl,
|
||||
TokenEndpoint: tokenUrl,
|
||||
UserinfoEndpoint: userinfoUrl,
|
||||
|
||||
Reference in New Issue
Block a user