From 18d0de2493d52a19f7e67fda7a39dd2745c58d74 Mon Sep 17 00:00:00 2001 From: Dennis Kugelmann Date: Thu, 18 Jul 2024 19:51:18 +0000 Subject: [PATCH 1/2] test: update incorrect usage of Auth0 in Salesforce tests --- selfservice/strategy/oidc/provider_salesforce_unit_test.go | 6 +++--- selfservice/strategy/oidc/provider_userinfo_test.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/selfservice/strategy/oidc/provider_salesforce_unit_test.go b/selfservice/strategy/oidc/provider_salesforce_unit_test.go index 4671f792262f..81638fb18050 100644 --- a/selfservice/strategy/oidc/provider_salesforce_unit_test.go +++ b/selfservice/strategy/oidc/provider_salesforce_unit_test.go @@ -14,11 +14,11 @@ import ( ) func TestSalesforceUpdatedAtWorkaround(t *testing.T) { - actual, err := authZeroUpdatedAtWorkaround([]byte("{}")) + actual, err := salesforceUpdatedAtWorkaround([]byte("{}")) require.NoError(t, err) assert.Equal(t, "{}", string(actual)) - actual, err = authZeroUpdatedAtWorkaround([]byte(`{"updated_at":1234}`)) + actual, err = salesforceUpdatedAtWorkaround([]byte(`{"updated_at":1234}`)) require.NoError(t, err) assert.Equal(t, `{"updated_at":1234}`, string(actual)) @@ -27,7 +27,7 @@ func TestSalesforceUpdatedAtWorkaround(t *testing.T) { "updated_at": timestamp, }) require.NoError(t, err) - actual, err = authZeroUpdatedAtWorkaround(input) + actual, err = salesforceUpdatedAtWorkaround(input) require.NoError(t, err) assert.Equal(t, fmt.Sprintf(`{"updated_at":%d}`, timestamp.Unix()), string(actual)) } diff --git a/selfservice/strategy/oidc/provider_userinfo_test.go b/selfservice/strategy/oidc/provider_userinfo_test.go index 931e93560318..7ed232d46fe4 100644 --- a/selfservice/strategy/oidc/provider_userinfo_test.go +++ b/selfservice/strategy/oidc/provider_userinfo_test.go @@ -93,7 +93,7 @@ func TestProviderClaimsRespectsErrorCodes(t *testing.T) { name: "salesforce", userInfoHandler: defaultUserinfoHandler, userInfoEndpoint: "https://www.salesforce.com/userinfo", - provider: oidc.NewProviderAuth0(&oidc.Configuration{ + provider: oidc.NewProviderSalesforce(&oidc.Configuration{ IssuerURL: "https://www.salesforce.com", ID: "salesforce", Provider: "salesforce", From 3f3161c8bc4f42134a4519fc6828acc7669fe4bd Mon Sep 17 00:00:00 2001 From: Dennis Kugelmann Date: Fri, 19 Jul 2024 00:53:46 +0000 Subject: [PATCH 2/2] fix: salesforce test --- selfservice/strategy/oidc/provider_userinfo_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfservice/strategy/oidc/provider_userinfo_test.go b/selfservice/strategy/oidc/provider_userinfo_test.go index 7ed232d46fe4..dde2507af319 100644 --- a/selfservice/strategy/oidc/provider_userinfo_test.go +++ b/selfservice/strategy/oidc/provider_userinfo_test.go @@ -92,7 +92,7 @@ func TestProviderClaimsRespectsErrorCodes(t *testing.T) { { name: "salesforce", userInfoHandler: defaultUserinfoHandler, - userInfoEndpoint: "https://www.salesforce.com/userinfo", + userInfoEndpoint: "https://www.salesforce.com/services/oauth2/userinfo", provider: oidc.NewProviderSalesforce(&oidc.Configuration{ IssuerURL: "https://www.salesforce.com", ID: "salesforce",