mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 01:37:31 +00:00
feat: Identity brokering (#730)
* feat: add/ remove external idps * feat: external idp add /remove * fix: auth proto * fix: handle login * feat: loginpolicy on authrequest * feat: idp providers on login * feat: link external idp * fix: check login policy on check username * feat: add mapping fields for idp config * feat: use user org id if existing * feat: use user org id if existing * feat: register external user * feat: register external user * feat: user linking * feat: user linking * feat: design external login * feat: design external login * fix: tests * fix: regenerate login design * feat: next step test linking process * feat: next step test linking process * feat: cascade remove external idps on user * fix: tests * fix: tests * feat: external idp requsts on users * fix: generate protos * feat: login styles * feat: login styles * fix: link user * fix: register user on specifig org * fix: user linking * fix: register external, linking auto * fix: remove unnecessary request from proto * fix: tests * fix: new oidc package * fix: migration version * fix: policy permissions * Update internal/ui/login/static/i18n/en.yaml Co-authored-by: Livio Amstutz <livio.a@gmail.com> * Update internal/ui/login/static/i18n/en.yaml Co-authored-by: Livio Amstutz <livio.a@gmail.com> * Update internal/ui/login/handler/renderer.go Co-authored-by: Livio Amstutz <livio.a@gmail.com> * Update internal/ui/login/handler/renderer.go Co-authored-by: Livio Amstutz <livio.a@gmail.com> * fix: pr requests * Update internal/ui/login/handler/link_users_handler.go Co-authored-by: Livio Amstutz <livio.a@gmail.com> * fix: pr requests * fix: pr requests * fix: pr requests * fix: login name size * fix: profile image light * fix: colors * fix: pr requests * fix: remove redirect uri validator * fix: remove redirect uri validator Co-authored-by: Livio Amstutz <livio.a@gmail.com>
This commit is contained in:
@@ -10,11 +10,12 @@ import (
|
||||
|
||||
type IDPConfig struct {
|
||||
es_models.ObjectRoot
|
||||
IDPConfigID string `json:"idpConfigId"`
|
||||
State int32 `json:"-"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Type int32 `json:"idpType,omitempty"`
|
||||
LogoSrc []byte `json:"logoSrc,omitempty"`
|
||||
IDPConfigID string `json:"idpConfigId"`
|
||||
State int32 `json:"-"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Type int32 `json:"idpType,omitempty"`
|
||||
LogoSrc []byte `json:"logoSrc,omitempty"`
|
||||
|
||||
OIDCIDPConfig *OIDCIDPConfig `json:"-"`
|
||||
}
|
||||
|
||||
|
@@ -12,11 +12,13 @@ import (
|
||||
|
||||
type OIDCIDPConfig struct {
|
||||
es_models.ObjectRoot
|
||||
IDPConfigID string `json:"idpConfigId"`
|
||||
ClientID string `json:"clientId"`
|
||||
ClientSecret *crypto.CryptoValue `json:"clientSecret,omitempty"`
|
||||
Issuer string `json:"issuer,omitempty"`
|
||||
Scopes pq.StringArray `json:"scopes,omitempty"`
|
||||
IDPConfigID string `json:"idpConfigId"`
|
||||
ClientID string `json:"clientId"`
|
||||
ClientSecret *crypto.CryptoValue `json:"clientSecret,omitempty"`
|
||||
Issuer string `json:"issuer,omitempty"`
|
||||
Scopes pq.StringArray `json:"scopes,omitempty"`
|
||||
IDPDisplayNameMapping int32 `json:"idpDisplayNameMapping,omitempty"`
|
||||
UsernameMapping int32 `json:"usernameMapping,omitempty"`
|
||||
}
|
||||
|
||||
func (c *OIDCIDPConfig) Changes(changed *OIDCIDPConfig) map[string]interface{} {
|
||||
@@ -25,7 +27,7 @@ func (c *OIDCIDPConfig) Changes(changed *OIDCIDPConfig) map[string]interface{} {
|
||||
if c.ClientID != changed.ClientID {
|
||||
changes["clientId"] = changed.ClientID
|
||||
}
|
||||
if c.ClientSecret != nil {
|
||||
if c.ClientSecret != nil && c.ClientSecret != changed.ClientSecret {
|
||||
changes["clientSecret"] = changed.ClientSecret
|
||||
}
|
||||
if c.Issuer != changed.Issuer {
|
||||
@@ -34,28 +36,38 @@ func (c *OIDCIDPConfig) Changes(changed *OIDCIDPConfig) map[string]interface{} {
|
||||
if !reflect.DeepEqual(c.Scopes, changed.Scopes) {
|
||||
changes["scopes"] = changed.Scopes
|
||||
}
|
||||
if c.IDPDisplayNameMapping != changed.IDPDisplayNameMapping {
|
||||
changes["idpDisplayNameMapping"] = changed.IDPDisplayNameMapping
|
||||
}
|
||||
if c.UsernameMapping != changed.UsernameMapping {
|
||||
changes["usernameMapping"] = changed.UsernameMapping
|
||||
}
|
||||
return changes
|
||||
}
|
||||
|
||||
func OIDCIDPConfigFromModel(config *model.OIDCIDPConfig) *OIDCIDPConfig {
|
||||
return &OIDCIDPConfig{
|
||||
ObjectRoot: config.ObjectRoot,
|
||||
IDPConfigID: config.IDPConfigID,
|
||||
ClientID: config.ClientID,
|
||||
ClientSecret: config.ClientSecret,
|
||||
Issuer: config.Issuer,
|
||||
Scopes: config.Scopes,
|
||||
ObjectRoot: config.ObjectRoot,
|
||||
IDPConfigID: config.IDPConfigID,
|
||||
ClientID: config.ClientID,
|
||||
ClientSecret: config.ClientSecret,
|
||||
Issuer: config.Issuer,
|
||||
Scopes: config.Scopes,
|
||||
IDPDisplayNameMapping: int32(config.IDPDisplayNameMapping),
|
||||
UsernameMapping: int32(config.UsernameMapping),
|
||||
}
|
||||
}
|
||||
|
||||
func OIDCIDPConfigToModel(config *OIDCIDPConfig) *model.OIDCIDPConfig {
|
||||
return &model.OIDCIDPConfig{
|
||||
ObjectRoot: config.ObjectRoot,
|
||||
IDPConfigID: config.IDPConfigID,
|
||||
ClientID: config.ClientID,
|
||||
ClientSecret: config.ClientSecret,
|
||||
Issuer: config.Issuer,
|
||||
Scopes: config.Scopes,
|
||||
ObjectRoot: config.ObjectRoot,
|
||||
IDPConfigID: config.IDPConfigID,
|
||||
ClientID: config.ClientID,
|
||||
ClientSecret: config.ClientSecret,
|
||||
Issuer: config.Issuer,
|
||||
Scopes: config.Scopes,
|
||||
IDPDisplayNameMapping: model.OIDCMappingField(config.IDPDisplayNameMapping),
|
||||
UsernameMapping: model.OIDCMappingField(config.UsernameMapping),
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user