mirror of
https://github.com/zitadel/zitadel.git
synced 2025-07-16 18:58:36 +00:00

# Which Problems Are Solved Currently if a user signs in using an IdP, once they sign out of Zitadel, the corresponding IdP session is not terminated. This can be the desired behavior. In some cases, e.g. when using a shared computer it results in a potential security risk, since a follower user might be able to sign in as the previous using the still open IdP session. # How the Problems Are Solved - Admins can enabled a federated logout option on SAML IdPs through the Admin and Management APIs. - During the termination of a login V1 session using OIDC end_session endpoint, Zitadel will check if an IdP was used to authenticate that session. - In case there was a SAML IdP used with Federated Logout enabled, it will intercept the logout process, store the information into the shared cache and redirect to the federated logout endpoint in the V1 login. - The V1 login federated logout endpoint checks every request on an existing cache entry. On success it will create a SAML logout request for the used IdP and either redirect or POST to the configured SLO endpoint. The cache entry is updated with a `redirected` state. - A SLO endpoint is added to the `/idp` handlers, which will handle the SAML logout responses. At the moment it will check again for an existing federated logout entry (with state `redirected`) in the cache. On success, the user is redirected to the initially provided `post_logout_redirect_uri` from the end_session request. # Additional Changes None # Additional Context - This PR merges the https://github.com/zitadel/zitadel/pull/9841 and https://github.com/zitadel/zitadel/pull/9854 to main, additionally updating the docs on Entra ID SAML. - closes #9228 - backport to 3.x --------- Co-authored-by: Silvan <27845747+adlerhurst@users.noreply.github.com> Co-authored-by: Zach Hirschtritt <zachary.hirschtritt@klaviyo.com>
95 lines
2.8 KiB
Go
95 lines
2.8 KiB
Go
// Code generated by "enumer -type Purpose -transform snake -trimprefix Purpose"; DO NOT EDIT.
|
|
|
|
package cache
|
|
|
|
import (
|
|
"fmt"
|
|
"strings"
|
|
)
|
|
|
|
const _PurposeName = "unspecifiedauthz_instancemilestonesorganizationid_p_form_callbackfederated_logout"
|
|
|
|
var _PurposeIndex = [...]uint8{0, 11, 25, 35, 47, 65, 81}
|
|
|
|
const _PurposeLowerName = "unspecifiedauthz_instancemilestonesorganizationid_p_form_callbackfederated_logout"
|
|
|
|
func (i Purpose) String() string {
|
|
if i < 0 || i >= Purpose(len(_PurposeIndex)-1) {
|
|
return fmt.Sprintf("Purpose(%d)", i)
|
|
}
|
|
return _PurposeName[_PurposeIndex[i]:_PurposeIndex[i+1]]
|
|
}
|
|
|
|
// An "invalid array index" compiler error signifies that the constant values have changed.
|
|
// Re-run the stringer command to generate them again.
|
|
func _PurposeNoOp() {
|
|
var x [1]struct{}
|
|
_ = x[PurposeUnspecified-(0)]
|
|
_ = x[PurposeAuthzInstance-(1)]
|
|
_ = x[PurposeMilestones-(2)]
|
|
_ = x[PurposeOrganization-(3)]
|
|
_ = x[PurposeIdPFormCallback-(4)]
|
|
_ = x[PurposeFederatedLogout-(5)]
|
|
}
|
|
|
|
var _PurposeValues = []Purpose{PurposeUnspecified, PurposeAuthzInstance, PurposeMilestones, PurposeOrganization, PurposeIdPFormCallback, PurposeFederatedLogout}
|
|
|
|
var _PurposeNameToValueMap = map[string]Purpose{
|
|
_PurposeName[0:11]: PurposeUnspecified,
|
|
_PurposeLowerName[0:11]: PurposeUnspecified,
|
|
_PurposeName[11:25]: PurposeAuthzInstance,
|
|
_PurposeLowerName[11:25]: PurposeAuthzInstance,
|
|
_PurposeName[25:35]: PurposeMilestones,
|
|
_PurposeLowerName[25:35]: PurposeMilestones,
|
|
_PurposeName[35:47]: PurposeOrganization,
|
|
_PurposeLowerName[35:47]: PurposeOrganization,
|
|
_PurposeName[47:65]: PurposeIdPFormCallback,
|
|
_PurposeLowerName[47:65]: PurposeIdPFormCallback,
|
|
_PurposeName[65:81]: PurposeFederatedLogout,
|
|
_PurposeLowerName[65:81]: PurposeFederatedLogout,
|
|
}
|
|
|
|
var _PurposeNames = []string{
|
|
_PurposeName[0:11],
|
|
_PurposeName[11:25],
|
|
_PurposeName[25:35],
|
|
_PurposeName[35:47],
|
|
_PurposeName[47:65],
|
|
_PurposeName[65:81],
|
|
}
|
|
|
|
// PurposeString retrieves an enum value from the enum constants string name.
|
|
// Throws an error if the param is not part of the enum.
|
|
func PurposeString(s string) (Purpose, error) {
|
|
if val, ok := _PurposeNameToValueMap[s]; ok {
|
|
return val, nil
|
|
}
|
|
|
|
if val, ok := _PurposeNameToValueMap[strings.ToLower(s)]; ok {
|
|
return val, nil
|
|
}
|
|
return 0, fmt.Errorf("%s does not belong to Purpose values", s)
|
|
}
|
|
|
|
// PurposeValues returns all values of the enum
|
|
func PurposeValues() []Purpose {
|
|
return _PurposeValues
|
|
}
|
|
|
|
// PurposeStrings returns a slice of all String values of the enum
|
|
func PurposeStrings() []string {
|
|
strs := make([]string, len(_PurposeNames))
|
|
copy(strs, _PurposeNames)
|
|
return strs
|
|
}
|
|
|
|
// IsAPurpose returns "true" if the value is listed in the enum definition. "false" otherwise
|
|
func (i Purpose) IsAPurpose() bool {
|
|
for _, v := range _PurposeValues {
|
|
if i == v {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|