You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove support for setting default scheme from user-jwts (#42578)
* Revert "Fix up reading auth schemes and setting default scheme (#42452)"
This reverts commit f0e1d1e.
* Bring back non-default scheme related changes
* Remove AuthenticationConfigureOptions
* Update src/Tools/dotnet-user-jwts/src/Helpers/JwtAuthenticationSchemeSettings.cs
Co-authored-by: Chris Ross <Tratcher@Outlook.com>
Co-authored-by: Chris Ross <Tratcher@Outlook.com>
privateconststringdefaultSchemesOptionsMsg="The default schemes can be set using either AddAuthentication(string defaultScheme) or AddAuthentication(Action<AuthenticationOptions> configureOptions) or by setting the Authentication:DefaultScheme property in configuration.";
18
17
19
18
/// <summary>
20
19
/// Constructor.
@@ -65,7 +64,7 @@ public virtual async Task<AuthenticateResult> AuthenticateAsync(HttpContext cont
65
64
scheme=defaultScheme?.Name;
66
65
if(scheme==null)
67
66
{
68
-
thrownewInvalidOperationException($"No authenticationScheme was specified, and there was no DefaultAuthenticateScheme found. {defaultSchemesOptionsMsg}");
67
+
thrownewInvalidOperationException($"No authenticationScheme was specified, and there was no DefaultAuthenticateScheme found. The default schemes can be set using either AddAuthentication(string defaultScheme) or AddAuthentication(Action<AuthenticationOptions> configureOptions).");
69
68
}
70
69
}
71
70
@@ -113,7 +112,7 @@ public virtual async Task ChallengeAsync(HttpContext context, string? scheme, Au
113
112
scheme=defaultChallengeScheme?.Name;
114
113
if(scheme==null)
115
114
{
116
-
thrownewInvalidOperationException($"No authenticationScheme was specified, and there was no DefaultChallengeScheme found. {defaultSchemesOptionsMsg}");
115
+
thrownewInvalidOperationException($"No authenticationScheme was specified, and there was no DefaultChallengeScheme found. The default schemes can be set using either AddAuthentication(string defaultScheme) or AddAuthentication(Action<AuthenticationOptions> configureOptions).");
thrownewInvalidOperationException($"No authenticationScheme was specified, and there was no DefaultForbidScheme found. {defaultSchemesOptionsMsg}");
143
+
thrownewInvalidOperationException($"No authenticationScheme was specified, and there was no DefaultForbidScheme found. The default schemes can be set using either AddAuthentication(string defaultScheme) or AddAuthentication(Action<AuthenticationOptions> configureOptions).");
thrownewInvalidOperationException($"No authenticationScheme was specified, and there was no DefaultSignInScheme found. {defaultSchemesOptionsMsg}");
189
+
thrownewInvalidOperationException($"No authenticationScheme was specified, and there was no DefaultSignInScheme found. The default schemes can be set using either AddAuthentication(string defaultScheme) or AddAuthentication(Action<AuthenticationOptions> configureOptions).");
thrownewInvalidOperationException($"No authenticationScheme was specified, and there was no DefaultSignOutScheme found. {defaultSchemesOptionsMsg}");
223
+
thrownewInvalidOperationException($"No authenticationScheme was specified, and there was no DefaultSignOutScheme found. The default schemes can be set using either AddAuthentication(string defaultScheme) or AddAuthentication(Action<AuthenticationOptions> configureOptions).");
0 commit comments