From b51436d3b25b7662154740e6321d9118c82ee8f0 Mon Sep 17 00:00:00 2001 From: Carmen Date: Thu, 4 Jun 2026 08:34:05 +0100 Subject: [PATCH 1/2] [Auth Flow API] Add oauth_provider_type and oauth_provider_alias to identification options Co-Authored-By: Claude Sonnet 4.6 --- .../oauth/demo_credential_provider.test.yaml | 1 + .../declarative/data_identification.go | 22 ++++++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/e2e/tests/oauth/demo_credential_provider.test.yaml b/e2e/tests/oauth/demo_credential_provider.test.yaml index e8dccb9208c..03d18bbf5b0 100644 --- a/e2e/tests/oauth/demo_credential_provider.test.yaml +++ b/e2e/tests/oauth/demo_credential_provider.test.yaml @@ -53,6 +53,7 @@ steps: "type": "oauth_data", "alias": "facebook", "oauth_provider_type": "facebook", + "oauth_provider_alias": "facebook", "oauth_authorization_url": "[[string]]", "provider_status": "using_demo_credentials" } diff --git a/pkg/lib/authenticationflow/declarative/data_identification.go b/pkg/lib/authenticationflow/declarative/data_identification.go index d577323fb4c..c5499cbb9d0 100644 --- a/pkg/lib/authenticationflow/declarative/data_identification.go +++ b/pkg/lib/authenticationflow/declarative/data_identification.go @@ -26,10 +26,14 @@ type IdentificationOption struct { Identification model.AuthenticationFlowIdentification `json:"identification"` BotProtection *BotProtectionData `json:"bot_protection,omitempty"` - // ProviderType is specific to OAuth. + // ProviderType is specific to OAuth. Kept for backwards compatibility; use OAuthProviderType. ProviderType string `json:"provider_type,omitempty"` - // Alias is specific to OAuth. + // OAuthProviderType is the canonical name for ProviderType. + OAuthProviderType string `json:"oauth_provider_type,omitempty"` + // Alias is specific to OAuth. Kept for backwards compatibility; use OAuthProviderAlias. Alias string `json:"alias,omitempty"` + // OAuthProviderAlias is the canonical name for Alias. + OAuthProviderAlias string `json:"oauth_provider_alias,omitempty"` // WechatAppType is specific to OAuth. WechatAppType wechat.AppType `json:"wechat_app_type,omitempty"` // ProviderStatus is specific to OAuth. @@ -63,12 +67,14 @@ func NewIdentificationOptionsOAuth(flows authflow.Flows, oauthConfig *config.OAu status := p.ComputeProviderStatus(demoCredentials) output = append(output, IdentificationOption{ - Identification: model.AuthenticationFlowIdentificationOAuth, - BotProtection: GetBotProtectionData(flows, authflowCfg, appCfg), - ProviderType: p.AsProviderConfig().Type(), - Alias: p.Alias(), - WechatAppType: wechat.ProviderConfig(p).AppType(), - ProviderStatus: status, + Identification: model.AuthenticationFlowIdentificationOAuth, + BotProtection: GetBotProtectionData(flows, authflowCfg, appCfg), + ProviderType: p.AsProviderConfig().Type(), + OAuthProviderType: p.AsProviderConfig().Type(), + Alias: p.Alias(), + OAuthProviderAlias: p.Alias(), + WechatAppType: wechat.ProviderConfig(p).AppType(), + ProviderStatus: status, }) } } From 36c7a5c4fe07432ad2b56315f53a08df9ebbf5af Mon Sep 17 00:00:00 2001 From: Carmen Date: Thu, 4 Jun 2026 09:26:24 +0100 Subject: [PATCH 2/2] [Auth Flow API] Add oauth_provider_alias to OAuthData Add oauth_provider_alias alongside the existing alias field in OAuthData, matching the canonical naming pattern established for IdentificationOption. Update e2e test to assert all four OAuth fields in identification options output. Co-Authored-By: Claude Sonnet 4.6 --- .../oauth/demo_credential_provider.test.yaml | 15 ++++++++++++++- .../authenticationflow/declarative/data_oauth.go | 2 ++ .../declarative/utils_common.go | 1 + 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/e2e/tests/oauth/demo_credential_provider.test.yaml b/e2e/tests/oauth/demo_credential_provider.test.yaml index 03d18bbf5b0..4c3d99b38e2 100644 --- a/e2e/tests/oauth/demo_credential_provider.test.yaml +++ b/e2e/tests/oauth/demo_credential_provider.test.yaml @@ -32,7 +32,20 @@ steps: result: | { "action": { - "type": "identify" + "type": "identify", + "data": { + "type": "identification_data", + "options": [ + { + "identification": "oauth", + "alias": "facebook", + "oauth_provider_alias": "facebook", + "provider_type": "facebook", + "oauth_provider_type": "facebook", + "provider_status": "using_demo_credentials" + } + ] + } } } diff --git a/pkg/lib/authenticationflow/declarative/data_oauth.go b/pkg/lib/authenticationflow/declarative/data_oauth.go index 772df6a714d..93430e57f85 100644 --- a/pkg/lib/authenticationflow/declarative/data_oauth.go +++ b/pkg/lib/authenticationflow/declarative/data_oauth.go @@ -10,7 +10,9 @@ type OAuthProviderStatus = config.OAuthProviderStatus type OAuthData struct { TypedData + // Alias is kept for backwards compatibility; use OAuthProviderAlias. Alias string `json:"alias,omitempty"` + OAuthProviderAlias string `json:"oauth_provider_alias,omitempty"` OAuthProviderType string `json:"oauth_provider_type,omitempty"` OAuthAuthorizationURL string `json:"oauth_authorization_url,omitempty"` WechatAppType wechat.AppType `json:"wechat_app_type,omitempty"` diff --git a/pkg/lib/authenticationflow/declarative/utils_common.go b/pkg/lib/authenticationflow/declarative/utils_common.go index ed0382fc849..79c61676989 100644 --- a/pkg/lib/authenticationflow/declarative/utils_common.go +++ b/pkg/lib/authenticationflow/declarative/utils_common.go @@ -825,6 +825,7 @@ func getOAuthData(ctx context.Context, deps *authflow.Dependencies, opts GetOAut data = NewOAuthData(OAuthData{ Alias: opts.Alias, + OAuthProviderAlias: opts.Alias, OAuthProviderType: providerConfig.Type(), OAuthAuthorizationURL: authorizationURL, WechatAppType: wechat.ProviderConfig(providerConfig).AppType(),