|
|
@ -423,10 +423,17 @@ public static partial class OpenIddictClientHandlers |
|
|
throw new InvalidOperationException(SR.GetResourceString(SR.ID0408)); |
|
|
throw new InvalidOperationException(SR.GetResourceString(SR.ID0408)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Resolve and attach the server configuration to the context if none has been set already.
|
|
|
|
|
|
if (context.Configuration is null) |
|
|
|
|
|
{ |
|
|
|
|
|
if (context.Registration.ConfigurationManager is null) |
|
|
|
|
|
{ |
|
|
|
|
|
throw new InvalidOperationException(SR.GetResourceString(SR.ID0422)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
try |
|
|
try |
|
|
{ |
|
|
{ |
|
|
// Resolve and attach the server configuration to the context if none has been set already.
|
|
|
context.Configuration = await context.Registration.ConfigurationManager |
|
|
context.Configuration ??= await context.Registration.ConfigurationManager |
|
|
|
|
|
.GetConfigurationAsync(context.CancellationToken) |
|
|
.GetConfigurationAsync(context.CancellationToken) |
|
|
.WaitAsync(context.CancellationToken) ?? |
|
|
.WaitAsync(context.CancellationToken) ?? |
|
|
throw new InvalidOperationException(SR.GetResourceString(SR.ID0140)); |
|
|
throw new InvalidOperationException(SR.GetResourceString(SR.ID0140)); |
|
|
@ -444,6 +451,7 @@ public static partial class OpenIddictClientHandlers |
|
|
|
|
|
|
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// Ensure the selected grant type, if explicitly set, is listed as supported in the configuration.
|
|
|
// Ensure the selected grant type, if explicitly set, is listed as supported in the configuration.
|
|
|
if (!string.IsNullOrEmpty(context.GrantType) && |
|
|
if (!string.IsNullOrEmpty(context.GrantType) && |
|
|
@ -1019,7 +1027,15 @@ public static partial class OpenIddictClientHandlers |
|
|
// Note: if the static registration cannot be found in the options, this may indicate
|
|
|
// Note: if the static registration cannot be found in the options, this may indicate
|
|
|
// the client was removed after the authorization dance started and thus, can no longer
|
|
|
// the client was removed after the authorization dance started and thus, can no longer
|
|
|
// be used to authenticate users. In this case, throw an exception to abort the flow.
|
|
|
// be used to authenticate users. In this case, throw an exception to abort the flow.
|
|
|
context.Registration = await _service.GetClientRegistrationByIdAsync(context.RegistrationId, context.CancellationToken); |
|
|
context.Registration ??= await _service.GetClientRegistrationByIdAsync(context.RegistrationId, context.CancellationToken); |
|
|
|
|
|
|
|
|
|
|
|
// Resolve and attach the server configuration to the context if none has been set already.
|
|
|
|
|
|
if (context.Configuration is null) |
|
|
|
|
|
{ |
|
|
|
|
|
if (context.Registration.ConfigurationManager is null) |
|
|
|
|
|
{ |
|
|
|
|
|
throw new InvalidOperationException(SR.GetResourceString(SR.ID0422)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
try |
|
|
try |
|
|
{ |
|
|
{ |
|
|
@ -1044,6 +1060,7 @@ public static partial class OpenIddictClientHandlers |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// Contains the logic responsible for ensuring the issuer parameter, if available, matches the expected issuer.
|
|
|
/// Contains the logic responsible for ensuring the issuer parameter, if available, matches the expected issuer.
|
|
|
@ -4209,10 +4226,17 @@ public static partial class OpenIddictClientHandlers |
|
|
throw new InvalidOperationException(SR.GetResourceString(SR.ID0408)); |
|
|
throw new InvalidOperationException(SR.GetResourceString(SR.ID0408)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Resolve and attach the server configuration to the context if none has been set already.
|
|
|
|
|
|
if (context.Configuration is null) |
|
|
|
|
|
{ |
|
|
|
|
|
if (context.Registration.ConfigurationManager is null) |
|
|
|
|
|
{ |
|
|
|
|
|
throw new InvalidOperationException(SR.GetResourceString(SR.ID0422)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
try |
|
|
try |
|
|
{ |
|
|
{ |
|
|
// Resolve and attach the server configuration to the context if none has been set already.
|
|
|
context.Configuration = await context.Registration.ConfigurationManager |
|
|
context.Configuration ??= await context.Registration.ConfigurationManager |
|
|
|
|
|
.GetConfigurationAsync(context.CancellationToken) |
|
|
.GetConfigurationAsync(context.CancellationToken) |
|
|
.WaitAsync(context.CancellationToken) ?? |
|
|
.WaitAsync(context.CancellationToken) ?? |
|
|
throw new InvalidOperationException(SR.GetResourceString(SR.ID0140)); |
|
|
throw new InvalidOperationException(SR.GetResourceString(SR.ID0140)); |
|
|
@ -4232,6 +4256,7 @@ public static partial class OpenIddictClientHandlers |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// Contains the logic responsible for negotiating the best flow
|
|
|
/// Contains the logic responsible for negotiating the best flow
|
|
|
@ -5852,10 +5877,17 @@ public static partial class OpenIddictClientHandlers |
|
|
throw new InvalidOperationException(SR.GetResourceString(SR.ID0408)); |
|
|
throw new InvalidOperationException(SR.GetResourceString(SR.ID0408)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Resolve and attach the server configuration to the context if none has been set already.
|
|
|
|
|
|
if (context.Configuration is null) |
|
|
|
|
|
{ |
|
|
|
|
|
if (context.Registration.ConfigurationManager is null) |
|
|
|
|
|
{ |
|
|
|
|
|
throw new InvalidOperationException(SR.GetResourceString(SR.ID0422)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
try |
|
|
try |
|
|
{ |
|
|
{ |
|
|
// Resolve and attach the server configuration to the context if none has been set already.
|
|
|
context.Configuration = await context.Registration.ConfigurationManager |
|
|
context.Configuration ??= await context.Registration.ConfigurationManager |
|
|
|
|
|
.GetConfigurationAsync(context.CancellationToken) |
|
|
.GetConfigurationAsync(context.CancellationToken) |
|
|
.WaitAsync(context.CancellationToken) ?? |
|
|
.WaitAsync(context.CancellationToken) ?? |
|
|
throw new InvalidOperationException(SR.GetResourceString(SR.ID0140)); |
|
|
throw new InvalidOperationException(SR.GetResourceString(SR.ID0140)); |
|
|
@ -5875,6 +5907,7 @@ public static partial class OpenIddictClientHandlers |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// Contains the logic responsible for attaching the client identifier to the sign-out request.
|
|
|
/// Contains the logic responsible for attaching the client identifier to the sign-out request.
|
|
|
|