mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 19:07:30 +00:00
feat: select idp and auto register (#2336)
* faet: auto regsiter config on idp * feat: auto register on login * feat: auto register on register * feat: redirect to selected identity provider * fix: test * fix: test * fix: user by id request org id * fix: migration version and test Co-authored-by: Livio Amstutz <livio.a@gmail.com>
This commit is contained in:
@@ -29,10 +29,11 @@ func NewRemoveIDPConfigNameUniqueConstraint(idpConfigName, resourceOwner string)
|
||||
type IDPConfigAddedEvent struct {
|
||||
eventstore.BaseEvent `json:"-"`
|
||||
|
||||
ConfigID string `json:"idpConfigId"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Typ domain.IDPConfigType `json:"idpType,omitempty"`
|
||||
StylingType domain.IDPConfigStylingType `json:"stylingType,omitempty"`
|
||||
ConfigID string `json:"idpConfigId"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Typ domain.IDPConfigType `json:"idpType,omitempty"`
|
||||
StylingType domain.IDPConfigStylingType `json:"stylingType,omitempty"`
|
||||
AutoRegister bool `json:"autoRegister,omitempty"`
|
||||
}
|
||||
|
||||
func NewIDPConfigAddedEvent(
|
||||
@@ -41,13 +42,15 @@ func NewIDPConfigAddedEvent(
|
||||
name string,
|
||||
configType domain.IDPConfigType,
|
||||
stylingType domain.IDPConfigStylingType,
|
||||
autoRegister bool,
|
||||
) *IDPConfigAddedEvent {
|
||||
return &IDPConfigAddedEvent{
|
||||
BaseEvent: *base,
|
||||
ConfigID: configID,
|
||||
Name: name,
|
||||
StylingType: stylingType,
|
||||
Typ: configType,
|
||||
BaseEvent: *base,
|
||||
ConfigID: configID,
|
||||
Name: name,
|
||||
StylingType: stylingType,
|
||||
Typ: configType,
|
||||
AutoRegister: autoRegister,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,10 +78,11 @@ func IDPConfigAddedEventMapper(event *repository.Event) (eventstore.EventReader,
|
||||
type IDPConfigChangedEvent struct {
|
||||
eventstore.BaseEvent `json:"-"`
|
||||
|
||||
ConfigID string `json:"idpConfigId"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
StylingType *domain.IDPConfigStylingType `json:"stylingType,omitempty"`
|
||||
oldName string `json:"-"`
|
||||
ConfigID string `json:"idpConfigId"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
StylingType *domain.IDPConfigStylingType `json:"stylingType,omitempty"`
|
||||
AutoRegister *bool `json:"autoRegister,omitempty"`
|
||||
oldName string `json:"-"`
|
||||
}
|
||||
|
||||
func (e *IDPConfigChangedEvent) Data() interface{} {
|
||||
@@ -129,6 +133,12 @@ func ChangeStyleType(styleType domain.IDPConfigStylingType) func(*IDPConfigChang
|
||||
}
|
||||
}
|
||||
|
||||
func ChangeAutoRegister(autoRegister bool) func(*IDPConfigChangedEvent) {
|
||||
return func(e *IDPConfigChangedEvent) {
|
||||
e.AutoRegister = &autoRegister
|
||||
}
|
||||
}
|
||||
|
||||
func IDPConfigChangedEventMapper(event *repository.Event) (eventstore.EventReader, error) {
|
||||
e := &IDPConfigChangedEvent{
|
||||
BaseEvent: *eventstore.BaseEventFromRepo(event),
|
||||
|
Reference in New Issue
Block a user