Browse Source

Fix invalid resource identifiers

pull/2327/head
Kévin Chalet 9 months ago
parent
commit
ec7612dd9c
  1. 172
      src/OpenIddict.Abstractions/OpenIddictResources.resx
  2. 12
      src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.cs
  3. 30
      src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationProviders.xml

172
src/OpenIddict.Abstractions/OpenIddictResources.resx

@ -1660,6 +1660,92 @@ To use the Entity Framework 6.x integration, reference the 'OpenIddict.EntityFra
To use the Entity Framework Core integration, reference the 'OpenIddict.EntityFrameworkCore' package and call 'services.AddOpenIddict().AddCore().UseEntityFrameworkCore()'.
To use the MongoDB integration, reference the 'OpenIddict.MongoDb' package and call 'services.AddOpenIddict().AddCore().UseMongoDb()'.</value>
</data>
<data name="ID0473" xml:space="preserve">
<value>The specified Alibaba Cloud/Aliyun region is not valid. Supported values are:
'China' (or 'CN'),
'Global' (or 'GLB').</value>
</data>
<data name="ID0474" xml:space="preserve">
<value>The specified Battle.net region is not valid. Supported values are:
'Asia-Pacific' (or 'APAC'),
'China' (or 'CN'),
'European Union' (or 'EU'),
'United States' (or 'US').</value>
</data>
<data name="ID0475" xml:space="preserve">
<value>The specified Amazon Cognito region is not valid. Supported values are:
'US East (Ohio)' (or 'us-east-2'),
'US East (N. Virginia)' (or 'us-east-1'),
'US West (N. California)' (or 'us-west-1'),
'US West (Oregon)' (or 'us-west-2'),
'Africa (Cape Town)' (or 'af-south-1'),
'Asia Pacific (Hong Kong)' (or 'ap-east-1'),
'Asia Pacific (Hyderabad)' (or 'ap-south-2'),
'Asia Pacific (Jakarta)' (or 'ap-southeast-3'),
'Asia Pacific (Malaysia)' (or 'ap-southeast-5'),
'Asia Pacific (Melbourne)' (or 'ap-southeast-4'),
'Asia Pacific (Mumbai)' (or 'ap-south-1'),
'Asia Pacific (Osaka)' (or 'ap-northeast-3'),
'Asia Pacific (Seoul)' (or 'ap-northeast-2'),
'Asia Pacific (Singapore)' (or 'ap-southeast-1'),
'Asia Pacific (Sydney)' (or 'ap-southeast-2'),
'Asia Pacific (Tokyo)' (or 'ap-northeast-1'),
'Canada (Central)' (or 'ca-central-1'),
'Canada West (Calgary)' (or 'ca-west-1'),
'Europe (Frankfurt)' (or 'eu-central-1'),
'Europe (Ireland)' (or 'eu-west-1'),
'Europe (London)' (or 'eu-west-2'),
'Europe (Milan)' (or 'eu-south-1'),
'Europe (Paris)' (or 'eu-west-3'),
'Europe (Spain)' (or 'eu-south-2'),
'Europe (Stockholm)' (or 'eu-north-1'),
'Europe (Zurich)' (or 'eu-central-2'),
'Israel (Tel Aviv)' (or 'il-central-1'),
'Middle East (Bahrain)' (or 'me-south-1'),
'Middle East (UAE)' (or 'me-central-1'),
'South America (São Paulo)' (or 'sa-east-1'),
'AWS GovCloud (US-East)' (or 'us-gov-east-1'),
'AWS GovCloud (US-West)' (or 'us-gov-west-1').
Alternatively, any value respecting the '[region]-[subregion]-[identifier]' pattern can also be specified.</value>
</data>
<data name="ID0476" xml:space="preserve">
<value>The specified Lark/Feishu region is not valid. Supported values are:
'China' (or 'CN'),
'Global' (or 'GLB').</value>
</data>
<data name="ID0477" xml:space="preserve">
<value>The specified Zoho region is not valid. Supported values are:
'Australia' (or 'AU'),
'Canada' (or 'CA'),
'European Union' (or 'EU'),
'India' (or 'IN'),
'Japan' (or 'JP'),
'Saudi Arabia' (or 'SA'),
'United Kingdom' (or 'UK'),
'United States' (or 'US').</value>
</data>
<data name="ID0478" xml:space="preserve">
<value>The specified Genesys Cloud region is not valid. Supported values are:
'Asia Pacific (Mumbai)' (or 'ap-south-1'),
'Asia Pacific (Osaka)' (or 'ap-northeast-3'),
'Asia Pacific (Seoul)' (or 'ap-northeast-2'),
'Asia Pacific (Sydney)' (or 'ap-southeast-2'),
'Asia Pacific (Tokyo)' (or 'ap-northeast-1'),
'Canada (Central)' (or 'ca-central-1'),
'Europe (Frankfurt)' (or 'eu-central-1'),
'Europe (Ireland)' (or 'eu-west-1'),
'Europe (London)' (or 'eu-west-2'),
'Europe (Zurich)' (or 'eu-central-2'),
'Middle East (UAE)' (or 'me-central-1'),
'South America (São Paulo)' (or 'sa-east-1'),
'US East (Virginia)' (or 'us-east-1'),
'US East 2 (Ohio)' (or 'us-east-2'),
'US West (Oregon)' (or 'us-west-2').</value>
</data>
<data name="ID0479" xml:space="preserve">
<value>The specified Stripe Connect account type is not valid. Supported values are 'Standard' and 'Express'.</value>
</data>
<data name="ID2000" xml:space="preserve">
<value>The security token is missing.</value>
</data>
@ -2209,92 +2295,6 @@ To use the MongoDB integration, reference the 'OpenIddict.MongoDb' package and c
<data name="ID2183" xml:space="preserve">
<value>This client application is not allowed to use the pushed authorization request endpoint.</value>
</data>
<data name="ID2184" xml:space="preserve">
<value>The specified Alibaba Cloud/Aliyun region is not valid. Supported values are:
'China' (or 'CN'),
'Global' (or 'GLB').</value>
</data>
<data name="ID2185" xml:space="preserve">
<value>The specified Battle.net region is not valid. Supported values are:
'Asia-Pacific' (or 'APAC'),
'China' (or 'CN'),
'European Union' (or 'EU'),
'United States' (or 'US').</value>
</data>
<data name="ID2186" xml:space="preserve">
<value>The specified Amazon Cognito region is not valid. Supported values are:
'US East (Ohio)' (or 'us-east-2'),
'US East (N. Virginia)' (or 'us-east-1'),
'US West (N. California)' (or 'us-west-1'),
'US West (Oregon)' (or 'us-west-2'),
'Africa (Cape Town)' (or 'af-south-1'),
'Asia Pacific (Hong Kong)' (or 'ap-east-1'),
'Asia Pacific (Hyderabad)' (or 'ap-south-2'),
'Asia Pacific (Jakarta)' (or 'ap-southeast-3'),
'Asia Pacific (Malaysia)' (or 'ap-southeast-5'),
'Asia Pacific (Melbourne)' (or 'ap-southeast-4'),
'Asia Pacific (Mumbai)' (or 'ap-south-1'),
'Asia Pacific (Osaka)' (or 'ap-northeast-3'),
'Asia Pacific (Seoul)' (or 'ap-northeast-2'),
'Asia Pacific (Singapore)' (or 'ap-southeast-1'),
'Asia Pacific (Sydney)' (or 'ap-southeast-2'),
'Asia Pacific (Tokyo)' (or 'ap-northeast-1'),
'Canada (Central)' (or 'ca-central-1'),
'Canada West (Calgary)' (or 'ca-west-1'),
'Europe (Frankfurt)' (or 'eu-central-1'),
'Europe (Ireland)' (or 'eu-west-1'),
'Europe (London)' (or 'eu-west-2'),
'Europe (Milan)' (or 'eu-south-1'),
'Europe (Paris)' (or 'eu-west-3'),
'Europe (Spain)' (or 'eu-south-2'),
'Europe (Stockholm)' (or 'eu-north-1'),
'Europe (Zurich)' (or 'eu-central-2'),
'Israel (Tel Aviv)' (or 'il-central-1'),
'Middle East (Bahrain)' (or 'me-south-1'),
'Middle East (UAE)' (or 'me-central-1'),
'South America (São Paulo)' (or 'sa-east-1'),
'AWS GovCloud (US-East)' (or 'us-gov-east-1'),
'AWS GovCloud (US-West)' (or 'us-gov-west-1').
Alternatively, any value respecting the '[region]-[subregion]-[identifier]' pattern can also be specified.</value>
</data>
<data name="ID2187" xml:space="preserve">
<value>The specified Lark/Feishu region is not valid. Supported values are:
'China' (or 'CN'),
'Global' (or 'GLB').</value>
</data>
<data name="ID2188" xml:space="preserve">
<value>The specified Zoho region is not valid. Supported values are:
'Australia' (or 'AU'),
'Canada' (or 'CA'),
'European Union' (or 'EU'),
'India' (or 'IN'),
'Japan' (or 'JP'),
'Saudi Arabia' (or 'SA'),
'United Kingdom' (or 'UK'),
'United States' (or 'US').</value>
</data>
<data name="ID2189" xml:space="preserve">
<value>The specified Genesys Cloud region is not valid. Supported values are:
'Asia Pacific (Mumbai)' (or 'ap-south-1'),
'Asia Pacific (Osaka)' (or 'ap-northeast-3'),
'Asia Pacific (Seoul)' (or 'ap-northeast-2'),
'Asia Pacific (Sydney)' (or 'ap-southeast-2'),
'Asia Pacific (Tokyo)' (or 'ap-northeast-1'),
'Canada (Central)' (or 'ca-central-1'),
'Europe (Frankfurt)' (or 'eu-central-1'),
'Europe (Ireland)' (or 'eu-west-1'),
'Europe (London)' (or 'eu-west-2'),
'Europe (Zurich)' (or 'eu-central-2'),
'Middle East (UAE)' (or 'me-central-1'),
'South America (São Paulo)' (or 'sa-east-1'),
'US East (Virginia)' (or 'us-east-1'),
'US East 2 (Ohio)' (or 'us-east-2'),
'US West (Oregon)' (or 'us-west-2').</value>
</data>
<data name="ID2190" xml:space="preserve">
<value>The specified Stripe Connect account type is not valid. Supported values are 'Standard' and 'Express'.</value>
</data>
<data name="ID4000" xml:space="preserve">
<value>The '{0}' parameter shouldn't be null or empty at this point.</value>
</data>

12
src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.cs

@ -549,7 +549,7 @@ public static partial class OpenIddictClientWebIntegrationHandlers
"UK" => new Uri("https://accounts.zoho.uk/oauth/v2/token", UriKind.Absolute),
"US" => new Uri("https://accounts.zoho.com/oauth/v2/token", UriKind.Absolute),
_ => throw new InvalidOperationException(SR.GetResourceString(SR.ID2188))
_ => throw new InvalidOperationException(SR.GetResourceString(SR.ID0477))
},
ProviderTypes.Zoho when context.GrantType is GrantTypes.RefreshToken
@ -566,7 +566,7 @@ public static partial class OpenIddictClientWebIntegrationHandlers
"UK" => new Uri("https://accounts.zoho.uk/oauth/v2/token", UriKind.Absolute),
"US" => new Uri("https://accounts.zoho.com/oauth/v2/token", UriKind.Absolute),
_ => throw new InvalidOperationException(SR.GetResourceString(SR.ID2188))
_ => throw new InvalidOperationException(SR.GetResourceString(SR.ID0477))
},
_ => context.TokenEndpoint
@ -1079,7 +1079,7 @@ public static partial class OpenIddictClientWebIntegrationHandlers
"UK" => new Uri("https://accounts.zoho.uk/oauth/user/info", UriKind.Absolute),
"US" => new Uri("https://accounts.zoho.com/oauth/user/info", UriKind.Absolute),
_ => throw new InvalidOperationException(SR.GetResourceString(SR.ID2188))
_ => throw new InvalidOperationException(SR.GetResourceString(SR.ID0477))
},
ProviderTypes.Zoho when context.GrantType is GrantTypes.RefreshToken
@ -1096,7 +1096,7 @@ public static partial class OpenIddictClientWebIntegrationHandlers
"UK" => new Uri("https://accounts.zoho.uk/oauth/user/info", UriKind.Absolute),
"US" => new Uri("https://accounts.zoho.com/oauth/user/info", UriKind.Absolute),
_ => throw new InvalidOperationException(SR.GetResourceString(SR.ID2188))
_ => throw new InvalidOperationException(SR.GetResourceString(SR.ID0477))
},
_ => context.UserInfoEndpoint
@ -1696,7 +1696,7 @@ public static partial class OpenIddictClientWebIntegrationHandlers
"express" => new Uri("https://connect.stripe.com/express/oauth/authorize", UriKind.Absolute),
"standard" => new Uri("https://connect.stripe.com/oauth/authorize", UriKind.Absolute),
_ => throw new InvalidOperationException(SR.GetResourceString(SR.ID2190))
_ => throw new InvalidOperationException(SR.GetResourceString(SR.ID0479))
},
// Zoho requires using a region-specific authorization endpoint.
@ -1715,7 +1715,7 @@ public static partial class OpenIddictClientWebIntegrationHandlers
"UK" => new Uri("https://accounts.zoho.uk/oauth/v2/auth", UriKind.Absolute),
"US" => new Uri("https://accounts.zoho.com/oauth/v2/auth", UriKind.Absolute),
_ => throw new InvalidOperationException(SR.GetResourceString(SR.ID2188))
_ => throw new InvalidOperationException(SR.GetResourceString(SR.ID0477))
},
_ => context.AuthorizationEndpoint

30
src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationProviders.xml

@ -92,12 +92,12 @@
'China' or 'CN' => 'https://oauth.aliyun.com/',
'Global' or 'GLB' => 'https://oauth.alibabacloud.com/',
_ => throw new InvalidOperationException(SR.GetResourceString(SR.ID2184)) }}"
_ => throw new InvalidOperationException(SR.GetResourceString(SR.ID0473)) }}"
ConfigurationEndpoint="{settings.Region switch {
'China' or 'CN' => 'https://oauth.aliyun.com/.well-known/openid-configuration',
'Global' or 'GLB' => 'https://oauth.alibabacloud.com/.well-known/openid-configuration',
_ => throw new InvalidOperationException(SR.GetResourceString(SR.ID2184)) }}" />
_ => throw new InvalidOperationException(SR.GetResourceString(SR.ID0473)) }}" />
<Constant Class="Regions" Value="China" Name="China" />
<Constant Class="Regions" Value="Global" Name="Global" />
@ -313,7 +313,7 @@
'European Union' or 'EU' => 'https://oauth.battle.net/',
'United States' or 'US' => 'https://oauth.battle.net/',
_ => throw new InvalidOperationException(SR.GetResourceString(SR.ID2185)) }}" />
_ => throw new InvalidOperationException(SR.GetResourceString(SR.ID0474)) }}" />
<Constant Class="Regions" Value="Asia-Pacific" Name="AsiaPacific" />
<Constant Class="Regions" Value="China" Name="China" />
@ -480,7 +480,7 @@
string value when Regex.IsMatch(value, @'^[a-z]{2,}(-[a-z]+-)?[a-z]+-\d+$') => $'https://cognito-idp.{value}.amazonaws.com/{settings.UserPoolId}',
_ => throw new InvalidOperationException(SR.GetResourceString(SR.ID2186)) }}" />
_ => throw new InvalidOperationException(SR.GetResourceString(SR.ID0475)) }}" />
<!--
Note: to make the region constants easier to read, only the name of
@ -886,7 +886,7 @@
'US East (Ohio)' or 'us-east-2' => 'https://login.use2.us-gov-pure.cloud/',
'US West (Oregon)' or 'us-west-2' => 'https://login.usw2.pure.cloud/',
_ => throw new InvalidOperationException(SR.GetResourceString(SR.ID2189)) }}">
_ => throw new InvalidOperationException(SR.GetResourceString(SR.ID0478)) }}">
<Configuration AuthorizationEndpoint="{settings.Region switch {
'Asia Pacific (Mumbai)' or 'ap-south-1' => 'https://login.aps1.pure.cloud/oauth/authorize',
'Asia Pacific (Osaka)' or 'ap-northeast-3' => 'https://login.apne3.pure.cloud/oauth/authorize',
@ -904,7 +904,7 @@
'US East (Ohio)' or 'us-east-2' => 'https://login.use2.us-gov-pure.cloud/oauth/authorize',
'US West (Oregon)' or 'us-west-2' => 'https://login.usw2.pure.cloud/oauth/authorize',
_ => throw new InvalidOperationException(SR.GetResourceString(SR.ID2189)) }}"
_ => throw new InvalidOperationException(SR.GetResourceString(SR.ID0478)) }}"
TokenEndpoint="{settings.Region switch {
'Asia Pacific (Mumbai)' or 'ap-south-1' => 'https://login.aps1.pure.cloud/oauth/token',
'Asia Pacific (Osaka)' or 'ap-northeast-3' => 'https://login.apne3.pure.cloud/oauth/token',
@ -922,7 +922,7 @@
'US East (Ohio)' or 'us-east-2' => 'https://login.use2.us-gov-pure.cloud/oauth/token',
'US West (Oregon)' or 'us-west-2' => 'https://login.usw2.pure.cloud/oauth/token',
_ => throw new InvalidOperationException(SR.GetResourceString(SR.ID2189)) }}"
_ => throw new InvalidOperationException(SR.GetResourceString(SR.ID0478)) }}"
UserInfoEndpoint="{settings.Region switch {
'Asia Pacific (Mumbai)' or 'ap-south-1' => 'https://api.aps1.pure.cloud/api/v2/users/me',
'Asia Pacific (Osaka)' or 'ap-northeast-3' => 'https://api.apne3.pure.cloud/api/v2/users/me',
@ -940,7 +940,7 @@
'US East (Ohio)' or 'us-east-2' => 'https://api.use2.us-gov-pure.cloud/api/v2/users/me',
'US West (Oregon)' or 'us-west-2' => 'https://api.usw2.pure.cloud/api/v2/users/me',
_ => throw new InvalidOperationException(SR.GetResourceString(SR.ID2189)) }}">
_ => throw new InvalidOperationException(SR.GetResourceString(SR.ID0478)) }}">
<GrantType Value="authorization_code" />
<GrantType Value="client_credentials" />
@ -1275,22 +1275,22 @@
'China' or 'CN' => 'https://passport.feishu.cn/',
'Global' or 'GLB' => 'https://passport.larksuite.com/',
_ => throw new InvalidOperationException(SR.GetResourceString(SR.ID2187)) }}">
_ => throw new InvalidOperationException(SR.GetResourceString(SR.ID0476)) }}">
<Configuration AuthorizationEndpoint="{settings.Region switch {
'China' or 'CN' => 'https://passport.feishu.cn/suite/passport/oauth/authorize',
'Global' or 'GLB' => 'https://passport.larksuite.com/suite/passport/oauth/authorize',
_ => throw new InvalidOperationException(SR.GetResourceString(SR.ID2187)) }}"
_ => throw new InvalidOperationException(SR.GetResourceString(SR.ID0476)) }}"
TokenEndpoint="{settings.Region switch {
'China' or 'CN' => 'https://passport.feishu.cn/suite/passport/oauth/token',
'Global' or 'GLB' => 'https://passport.larksuite.com/suite/passport/oauth/token',
_ => throw new InvalidOperationException(SR.GetResourceString(SR.ID2187)) }}"
_ => throw new InvalidOperationException(SR.GetResourceString(SR.ID0476)) }}"
UserInfoEndpoint="{settings.Region switch {
'China' or 'CN' => 'https://passport.feishu.cn/suite/passport/oauth/userinfo',
'Global' or 'GLB' => 'https://passport.larksuite.com/suite/passport/oauth/userinfo',
_ => throw new InvalidOperationException(SR.GetResourceString(SR.ID2187)) }}">
_ => throw new InvalidOperationException(SR.GetResourceString(SR.ID0476)) }}">
<GrantType Value="authorization_code" />
<GrantType Value="refresh_token" />
</Configuration>
@ -2043,7 +2043,7 @@
'express' => 'https://connect.stripe.com/express/oauth/authorize',
'standard' => 'https://connect.stripe.com/oauth/authorize',
_ => throw new InvalidOperationException(SR.GetResourceString(SR.ID2190)) }}"
_ => throw new InvalidOperationException(SR.GetResourceString(SR.ID0479)) }}"
TokenEndpoint="https://connect.stripe.com/oauth/token" />
<!--
@ -2659,7 +2659,7 @@
'United Kingdom' or 'UK' => 'https://accounts.zoho.uk/oauth/v2/auth',
'United States' or 'US' => 'https://accounts.zoho.com/oauth/v2/auth',
_ => throw new InvalidOperationException(SR.GetResourceString(SR.ID2188)) }}"
_ => throw new InvalidOperationException(SR.GetResourceString(SR.ID0477)) }}"
TokenEndpoint="{settings.Region switch {
'Australia' or 'AU' => 'https://accounts.zoho.com.au/oauth/v2/token',
'Canada' or 'CA' => 'https://accounts.zohocloud.ca/oauth/v2/token',
@ -2670,7 +2670,7 @@
'United Kingdom' or 'UK' => 'https://accounts.zoho.uk/oauth/v2/token',
'United States' or 'US' => 'https://accounts.zoho.com/oauth/v2/token',
_ => throw new InvalidOperationException(SR.GetResourceString(SR.ID2188)) }}">
_ => throw new InvalidOperationException(SR.GetResourceString(SR.ID0477)) }}">
<CodeChallengeMethod Value="S256" />
<GrantType Value="authorization_code" />

Loading…
Cancel
Save