|
|
@ -903,17 +903,11 @@ public static partial class OpenIddictClientHandlers |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Resolve the grant types supported by the authorization endpoint, if available.
|
|
|
// Resolve the grant types supported by the authorization endpoint, if available.
|
|
|
var types = context.Response[Metadata.GrantTypesSupported]?.GetUnnamedParameters(); |
|
|
foreach (var type in (ImmutableArray<string?>?) context.Response[Metadata.GrantTypesSupported] ?? []) |
|
|
if (types is { Count: > 0 }) |
|
|
|
|
|
{ |
|
|
{ |
|
|
for (var index = 0; index < types.Count; index++) |
|
|
if (!string.IsNullOrEmpty(type)) |
|
|
{ |
|
|
{ |
|
|
// Note: custom values are allowed in this case.
|
|
|
context.Configuration.GrantTypesSupported.Add(type); |
|
|
var type = (string?) types[index]; |
|
|
|
|
|
if (!string.IsNullOrEmpty(type)) |
|
|
|
|
|
{ |
|
|
|
|
|
context.Configuration.GrantTypesSupported.Add(type); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -945,17 +939,11 @@ public static partial class OpenIddictClientHandlers |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Resolve the response modes supported by the authorization endpoint, if available.
|
|
|
// Resolve the response modes supported by the authorization endpoint, if available.
|
|
|
var modes = context.Response[Metadata.ResponseModesSupported]?.GetUnnamedParameters(); |
|
|
foreach (var mode in (ImmutableArray<string?>?) context.Response[Metadata.ResponseModesSupported] ?? []) |
|
|
if (modes is { Count: > 0 }) |
|
|
|
|
|
{ |
|
|
{ |
|
|
for (var index = 0; index < modes.Count; index++) |
|
|
if (!string.IsNullOrEmpty(mode)) |
|
|
{ |
|
|
{ |
|
|
// Note: custom values are allowed in this case.
|
|
|
context.Configuration.ResponseModesSupported.Add(mode); |
|
|
var mode = (string?) modes[index]; |
|
|
|
|
|
if (!string.IsNullOrEmpty(mode)) |
|
|
|
|
|
{ |
|
|
|
|
|
context.Configuration.ResponseModesSupported.Add(mode); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -987,17 +975,11 @@ public static partial class OpenIddictClientHandlers |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Resolve the response types supported by the authorization endpoint, if available.
|
|
|
// Resolve the response types supported by the authorization endpoint, if available.
|
|
|
var types = context.Response[Metadata.ResponseTypesSupported]?.GetUnnamedParameters(); |
|
|
foreach (var type in (ImmutableArray<string?>?) context.Response[Metadata.ResponseTypesSupported] ?? []) |
|
|
if (types is { Count: > 0 }) |
|
|
|
|
|
{ |
|
|
{ |
|
|
for (var index = 0; index < types.Count; index++) |
|
|
if (!string.IsNullOrEmpty(type)) |
|
|
{ |
|
|
{ |
|
|
// Note: custom values are allowed in this case.
|
|
|
context.Configuration.ResponseTypesSupported.Add(type); |
|
|
var type = (string?) types[index]; |
|
|
|
|
|
if (!string.IsNullOrEmpty(type)) |
|
|
|
|
|
{ |
|
|
|
|
|
context.Configuration.ResponseTypesSupported.Add(type); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -1029,17 +1011,11 @@ public static partial class OpenIddictClientHandlers |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Resolve the code challenge methods supported by the authorization endpoint, if available.
|
|
|
// Resolve the code challenge methods supported by the authorization endpoint, if available.
|
|
|
var methods = context.Response[Metadata.CodeChallengeMethodsSupported]?.GetUnnamedParameters(); |
|
|
foreach (var method in (ImmutableArray<string?>?) context.Response[Metadata.CodeChallengeMethodsSupported] ?? []) |
|
|
if (methods is { Count: > 0 }) |
|
|
|
|
|
{ |
|
|
{ |
|
|
for (var index = 0; index < methods.Count; index++) |
|
|
if (!string.IsNullOrEmpty(method)) |
|
|
{ |
|
|
{ |
|
|
// Note: custom values are allowed in this case.
|
|
|
context.Configuration.CodeChallengeMethodsSupported.Add(method); |
|
|
var method = (string?) methods[index]; |
|
|
|
|
|
if (!string.IsNullOrEmpty(method)) |
|
|
|
|
|
{ |
|
|
|
|
|
context.Configuration.CodeChallengeMethodsSupported.Add(method); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -1071,17 +1047,11 @@ public static partial class OpenIddictClientHandlers |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Resolve the scopes supported by the remote server, if available.
|
|
|
// Resolve the scopes supported by the remote server, if available.
|
|
|
var scopes = context.Response[Metadata.ScopesSupported]?.GetUnnamedParameters(); |
|
|
foreach (var scope in (ImmutableArray<string?>?) context.Response[Metadata.ScopesSupported] ?? []) |
|
|
if (scopes is { Count: > 0 }) |
|
|
|
|
|
{ |
|
|
{ |
|
|
for (var index = 0; index < scopes.Count; index++) |
|
|
if (!string.IsNullOrEmpty(scope)) |
|
|
{ |
|
|
{ |
|
|
// Note: custom values are allowed in this case.
|
|
|
context.Configuration.ScopesSupported.Add(scope); |
|
|
var scope = (string?) scopes[index]; |
|
|
|
|
|
if (!string.IsNullOrEmpty(scope)) |
|
|
|
|
|
{ |
|
|
|
|
|
context.Configuration.ScopesSupported.Add(scope); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -1210,17 +1180,11 @@ public static partial class OpenIddictClientHandlers |
|
|
//
|
|
|
//
|
|
|
// Note: "device_authorization_endpoint_auth_methods_supported" is not a standard parameter
|
|
|
// Note: "device_authorization_endpoint_auth_methods_supported" is not a standard parameter
|
|
|
// but is supported by OpenIddict 4.3.0 and higher for consistency with the other endpoints.
|
|
|
// but is supported by OpenIddict 4.3.0 and higher for consistency with the other endpoints.
|
|
|
var methods = context.Response[Metadata.DeviceAuthorizationEndpointAuthMethodsSupported]?.GetUnnamedParameters(); |
|
|
foreach (var method in (ImmutableArray<string?>?) context.Response[Metadata.DeviceAuthorizationEndpointAuthMethodsSupported] ?? []) |
|
|
if (methods is { Count: > 0 }) |
|
|
|
|
|
{ |
|
|
{ |
|
|
for (var index = 0; index < methods.Count; index++) |
|
|
if (!string.IsNullOrEmpty(method)) |
|
|
{ |
|
|
{ |
|
|
// Note: custom values are allowed in this case.
|
|
|
context.Configuration.DeviceAuthorizationEndpointAuthMethodsSupported.Add(method); |
|
|
var method = (string?) methods[index]; |
|
|
|
|
|
if (!string.IsNullOrEmpty(method)) |
|
|
|
|
|
{ |
|
|
|
|
|
context.Configuration.DeviceAuthorizationEndpointAuthMethodsSupported.Add(method); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -1253,17 +1217,11 @@ public static partial class OpenIddictClientHandlers |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Resolve the client authentication methods supported by the introspection endpoint, if available.
|
|
|
// Resolve the client authentication methods supported by the introspection endpoint, if available.
|
|
|
var methods = context.Response[Metadata.IntrospectionEndpointAuthMethodsSupported]?.GetUnnamedParameters(); |
|
|
foreach (var method in (ImmutableArray<string?>?) context.Response[Metadata.IntrospectionEndpointAuthMethodsSupported] ?? []) |
|
|
if (methods is { Count: > 0 }) |
|
|
|
|
|
{ |
|
|
{ |
|
|
for (var index = 0; index < methods.Count; index++) |
|
|
if (!string.IsNullOrEmpty(method)) |
|
|
{ |
|
|
{ |
|
|
// Note: custom values are allowed in this case.
|
|
|
context.Configuration.IntrospectionEndpointAuthMethodsSupported.Add(method); |
|
|
var method = (string?) methods[index]; |
|
|
|
|
|
if (!string.IsNullOrEmpty(method)) |
|
|
|
|
|
{ |
|
|
|
|
|
context.Configuration.IntrospectionEndpointAuthMethodsSupported.Add(method); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -1299,17 +1257,11 @@ public static partial class OpenIddictClientHandlers |
|
|
//
|
|
|
//
|
|
|
// Note: "pushed_authorization_request_endpoint_auth_methods_supported" is not a standard parameter
|
|
|
// Note: "pushed_authorization_request_endpoint_auth_methods_supported" is not a standard parameter
|
|
|
// but is supported by OpenIddict 6.1.0 and higher for consistency with the other endpoints.
|
|
|
// but is supported by OpenIddict 6.1.0 and higher for consistency with the other endpoints.
|
|
|
var methods = context.Response[Metadata.PushedAuthorizationRequestEndpointAuthMethodsSupported]?.GetUnnamedParameters(); |
|
|
foreach (var method in (ImmutableArray<string?>?) context.Response[Metadata.PushedAuthorizationRequestEndpointAuthMethodsSupported] ?? []) |
|
|
if (methods is { Count: > 0 }) |
|
|
|
|
|
{ |
|
|
{ |
|
|
for (var index = 0; index < methods.Count; index++) |
|
|
if (!string.IsNullOrEmpty(method)) |
|
|
{ |
|
|
{ |
|
|
// Note: custom values are allowed in this case.
|
|
|
context.Configuration.PushedAuthorizationEndpointAuthMethodsSupported.Add(method); |
|
|
var method = (string?) methods[index]; |
|
|
|
|
|
if (!string.IsNullOrEmpty(method)) |
|
|
|
|
|
{ |
|
|
|
|
|
context.Configuration.PushedAuthorizationEndpointAuthMethodsSupported.Add(method); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -1342,17 +1294,11 @@ public static partial class OpenIddictClientHandlers |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Resolve the client authentication methods supported by the revocation endpoint, if available.
|
|
|
// Resolve the client authentication methods supported by the revocation endpoint, if available.
|
|
|
var methods = context.Response[Metadata.RevocationEndpointAuthMethodsSupported]?.GetUnnamedParameters(); |
|
|
foreach (var method in (ImmutableArray<string?>?) context.Response[Metadata.RevocationEndpointAuthMethodsSupported] ?? []) |
|
|
if (methods is { Count: > 0 }) |
|
|
|
|
|
{ |
|
|
{ |
|
|
for (var index = 0; index < methods.Count; index++) |
|
|
if (!string.IsNullOrEmpty(method)) |
|
|
{ |
|
|
{ |
|
|
// Note: custom values are allowed in this case.
|
|
|
context.Configuration.RevocationEndpointAuthMethodsSupported.Add(method); |
|
|
var method = (string?) methods[index]; |
|
|
|
|
|
if (!string.IsNullOrEmpty(method)) |
|
|
|
|
|
{ |
|
|
|
|
|
context.Configuration.RevocationEndpointAuthMethodsSupported.Add(method); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -1385,17 +1331,11 @@ public static partial class OpenIddictClientHandlers |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Resolve the client authentication methods supported by the token endpoint, if available.
|
|
|
// Resolve the client authentication methods supported by the token endpoint, if available.
|
|
|
var methods = context.Response[Metadata.TokenEndpointAuthMethodsSupported]?.GetUnnamedParameters(); |
|
|
foreach (var method in (ImmutableArray<string?>?) context.Response[Metadata.TokenEndpointAuthMethodsSupported] ?? []) |
|
|
if (methods is { Count: > 0 }) |
|
|
|
|
|
{ |
|
|
{ |
|
|
for (var index = 0; index < methods.Count; index++) |
|
|
if (!string.IsNullOrEmpty(method)) |
|
|
{ |
|
|
{ |
|
|
// Note: custom values are allowed in this case.
|
|
|
context.Configuration.TokenEndpointAuthMethodsSupported.Add(method); |
|
|
var method = (string?) methods[index]; |
|
|
|
|
|
if (!string.IsNullOrEmpty(method)) |
|
|
|
|
|
{ |
|
|
|
|
|
context.Configuration.TokenEndpointAuthMethodsSupported.Add(method); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|