mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 00:17:32 +00:00
fix: use of generic oauth provider (#5345)
Adds a id_attribute to the GenericOAuthProvider, which is used to map the external User. Further mapping can be done in actions by using the `rawInfo` of the new `ctx.v1.providerInfo` field.
This commit is contained in:
@@ -29,13 +29,14 @@ var (
|
||||
` projections.idp_templates2.is_auto_creation,` +
|
||||
` projections.idp_templates2.is_auto_update,` +
|
||||
// oauth
|
||||
` projections.idp_templates2_oauth.idp_id,` +
|
||||
` projections.idp_templates2_oauth.client_id,` +
|
||||
` projections.idp_templates2_oauth.client_secret,` +
|
||||
` projections.idp_templates2_oauth.authorization_endpoint,` +
|
||||
` projections.idp_templates2_oauth.token_endpoint,` +
|
||||
` projections.idp_templates2_oauth.user_endpoint,` +
|
||||
` projections.idp_templates2_oauth.scopes,` +
|
||||
` projections.idp_templates2_oauth2.idp_id,` +
|
||||
` projections.idp_templates2_oauth2.client_id,` +
|
||||
` projections.idp_templates2_oauth2.client_secret,` +
|
||||
` projections.idp_templates2_oauth2.authorization_endpoint,` +
|
||||
` projections.idp_templates2_oauth2.token_endpoint,` +
|
||||
` projections.idp_templates2_oauth2.user_endpoint,` +
|
||||
` projections.idp_templates2_oauth2.scopes,` +
|
||||
` projections.idp_templates2_oauth2.id_attribute,` +
|
||||
// oidc
|
||||
` projections.idp_templates2_oidc.idp_id,` +
|
||||
` projections.idp_templates2_oidc.issuer,` +
|
||||
@@ -77,7 +78,7 @@ var (
|
||||
` projections.idp_templates2_ldap.avatar_url_attribute,` +
|
||||
` projections.idp_templates2_ldap.profile_attribute` +
|
||||
` FROM projections.idp_templates2` +
|
||||
` LEFT JOIN projections.idp_templates2_oauth ON projections.idp_templates2.id = projections.idp_templates2_oauth.idp_id AND projections.idp_templates2.instance_id = projections.idp_templates2_oauth.instance_id` +
|
||||
` LEFT JOIN projections.idp_templates2_oauth2 ON projections.idp_templates2.id = projections.idp_templates2_oauth2.idp_id AND projections.idp_templates2.instance_id = projections.idp_templates2_oauth2.instance_id` +
|
||||
` LEFT JOIN projections.idp_templates2_oidc ON projections.idp_templates2.id = projections.idp_templates2_oidc.idp_id AND projections.idp_templates2.instance_id = projections.idp_templates2_oidc.instance_id` +
|
||||
` LEFT JOIN projections.idp_templates2_jwt ON projections.idp_templates2.id = projections.idp_templates2_jwt.idp_id AND projections.idp_templates2.instance_id = projections.idp_templates2_jwt.instance_id` +
|
||||
` LEFT JOIN projections.idp_templates2_google ON projections.idp_templates2.id = projections.idp_templates2_google.idp_id AND projections.idp_templates2.instance_id = projections.idp_templates2_google.instance_id` +
|
||||
@@ -105,6 +106,7 @@ var (
|
||||
"token_endpoint",
|
||||
"user_endpoint",
|
||||
"scopes",
|
||||
"id_attribute",
|
||||
// oidc config
|
||||
"id_id",
|
||||
"issuer",
|
||||
@@ -160,13 +162,14 @@ var (
|
||||
` projections.idp_templates2.is_auto_creation,` +
|
||||
` projections.idp_templates2.is_auto_update,` +
|
||||
// oauth
|
||||
` projections.idp_templates2_oauth.idp_id,` +
|
||||
` projections.idp_templates2_oauth.client_id,` +
|
||||
` projections.idp_templates2_oauth.client_secret,` +
|
||||
` projections.idp_templates2_oauth.authorization_endpoint,` +
|
||||
` projections.idp_templates2_oauth.token_endpoint,` +
|
||||
` projections.idp_templates2_oauth.user_endpoint,` +
|
||||
` projections.idp_templates2_oauth.scopes,` +
|
||||
` projections.idp_templates2_oauth2.idp_id,` +
|
||||
` projections.idp_templates2_oauth2.client_id,` +
|
||||
` projections.idp_templates2_oauth2.client_secret,` +
|
||||
` projections.idp_templates2_oauth2.authorization_endpoint,` +
|
||||
` projections.idp_templates2_oauth2.token_endpoint,` +
|
||||
` projections.idp_templates2_oauth2.user_endpoint,` +
|
||||
` projections.idp_templates2_oauth2.scopes,` +
|
||||
` projections.idp_templates2_oauth2.id_attribute,` +
|
||||
// oidc
|
||||
` projections.idp_templates2_oidc.idp_id,` +
|
||||
` projections.idp_templates2_oidc.issuer,` +
|
||||
@@ -209,7 +212,7 @@ var (
|
||||
` projections.idp_templates2_ldap.profile_attribute,` +
|
||||
` COUNT(*) OVER ()` +
|
||||
` FROM projections.idp_templates2` +
|
||||
` LEFT JOIN projections.idp_templates2_oauth ON projections.idp_templates2.id = projections.idp_templates2_oauth.idp_id AND projections.idp_templates2.instance_id = projections.idp_templates2_oauth.instance_id` +
|
||||
` LEFT JOIN projections.idp_templates2_oauth2 ON projections.idp_templates2.id = projections.idp_templates2_oauth2.idp_id AND projections.idp_templates2.instance_id = projections.idp_templates2_oauth2.instance_id` +
|
||||
` LEFT JOIN projections.idp_templates2_oidc ON projections.idp_templates2.id = projections.idp_templates2_oidc.idp_id AND projections.idp_templates2.instance_id = projections.idp_templates2_oidc.instance_id` +
|
||||
` LEFT JOIN projections.idp_templates2_jwt ON projections.idp_templates2.id = projections.idp_templates2_jwt.idp_id AND projections.idp_templates2.instance_id = projections.idp_templates2_jwt.instance_id` +
|
||||
` LEFT JOIN projections.idp_templates2_google ON projections.idp_templates2.id = projections.idp_templates2_google.idp_id AND projections.idp_templates2.instance_id = projections.idp_templates2_google.instance_id` +
|
||||
@@ -237,6 +240,7 @@ var (
|
||||
"token_endpoint",
|
||||
"user_endpoint",
|
||||
"scopes",
|
||||
"id_attribute",
|
||||
// oidc config
|
||||
"id_id",
|
||||
"issuer",
|
||||
@@ -339,6 +343,7 @@ func Test_IDPTemplateTemplatesPrepares(t *testing.T) {
|
||||
"token",
|
||||
"user",
|
||||
database.StringArray{"profile"},
|
||||
"id-attribute",
|
||||
// oidc
|
||||
nil,
|
||||
nil,
|
||||
@@ -404,6 +409,7 @@ func Test_IDPTemplateTemplatesPrepares(t *testing.T) {
|
||||
TokenEndpoint: "token",
|
||||
UserEndpoint: "user",
|
||||
Scopes: []string{"profile"},
|
||||
IDAttribute: "id-attribute",
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -436,6 +442,7 @@ func Test_IDPTemplateTemplatesPrepares(t *testing.T) {
|
||||
nil,
|
||||
nil,
|
||||
nil,
|
||||
nil,
|
||||
// oidc
|
||||
"idp-id",
|
||||
"issuer",
|
||||
@@ -531,6 +538,7 @@ func Test_IDPTemplateTemplatesPrepares(t *testing.T) {
|
||||
nil,
|
||||
nil,
|
||||
nil,
|
||||
nil,
|
||||
// oidc
|
||||
nil,
|
||||
nil,
|
||||
@@ -626,6 +634,7 @@ func Test_IDPTemplateTemplatesPrepares(t *testing.T) {
|
||||
nil,
|
||||
nil,
|
||||
nil,
|
||||
nil,
|
||||
// oidc
|
||||
nil,
|
||||
nil,
|
||||
@@ -720,6 +729,7 @@ func Test_IDPTemplateTemplatesPrepares(t *testing.T) {
|
||||
nil,
|
||||
nil,
|
||||
nil,
|
||||
nil,
|
||||
// oidc
|
||||
nil,
|
||||
nil,
|
||||
@@ -833,6 +843,7 @@ func Test_IDPTemplateTemplatesPrepares(t *testing.T) {
|
||||
nil,
|
||||
nil,
|
||||
nil,
|
||||
nil,
|
||||
// oidc
|
||||
nil,
|
||||
nil,
|
||||
@@ -957,6 +968,7 @@ func Test_IDPTemplateTemplatesPrepares(t *testing.T) {
|
||||
nil,
|
||||
nil,
|
||||
nil,
|
||||
nil,
|
||||
// oidc
|
||||
nil,
|
||||
nil,
|
||||
@@ -1079,6 +1091,7 @@ func Test_IDPTemplateTemplatesPrepares(t *testing.T) {
|
||||
nil,
|
||||
nil,
|
||||
nil,
|
||||
nil,
|
||||
// oidc
|
||||
nil,
|
||||
nil,
|
||||
@@ -1176,6 +1189,7 @@ func Test_IDPTemplateTemplatesPrepares(t *testing.T) {
|
||||
nil,
|
||||
nil,
|
||||
nil,
|
||||
nil,
|
||||
// oidc
|
||||
nil,
|
||||
nil,
|
||||
@@ -1239,6 +1253,7 @@ func Test_IDPTemplateTemplatesPrepares(t *testing.T) {
|
||||
nil,
|
||||
nil,
|
||||
nil,
|
||||
nil,
|
||||
// oidc
|
||||
nil,
|
||||
nil,
|
||||
@@ -1302,6 +1317,7 @@ func Test_IDPTemplateTemplatesPrepares(t *testing.T) {
|
||||
"token",
|
||||
"user",
|
||||
database.StringArray{"profile"},
|
||||
"id-attribute",
|
||||
// oidc
|
||||
nil,
|
||||
nil,
|
||||
@@ -1365,6 +1381,7 @@ func Test_IDPTemplateTemplatesPrepares(t *testing.T) {
|
||||
nil,
|
||||
nil,
|
||||
nil,
|
||||
nil,
|
||||
// oidc
|
||||
"idp-id-oidc",
|
||||
"issuer",
|
||||
@@ -1428,6 +1445,7 @@ func Test_IDPTemplateTemplatesPrepares(t *testing.T) {
|
||||
nil,
|
||||
nil,
|
||||
nil,
|
||||
nil,
|
||||
// oidc
|
||||
nil,
|
||||
nil,
|
||||
@@ -1561,6 +1579,7 @@ func Test_IDPTemplateTemplatesPrepares(t *testing.T) {
|
||||
TokenEndpoint: "token",
|
||||
UserEndpoint: "user",
|
||||
Scopes: []string{"profile"},
|
||||
IDAttribute: "id-attribute",
|
||||
},
|
||||
},
|
||||
{
|
||||
|
Reference in New Issue
Block a user