We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7ac5c4a commit 7b6c9fdCopy full SHA for 7b6c9fd
samples/ProtectedMCPClient/BasicOAuthAuthorizationProvider.cs
@@ -239,6 +239,12 @@ public BasicOAuthAuthorizationProvider(
239
240
private Uri BuildAuthorizationUrl(AuthorizationServerMetadata authServerMetadata, string codeChallenge)
241
{
242
+ if (authServerMetadata.AuthorizationEndpoint.Scheme != Uri.UriSchemeHttp &&
243
+ authServerMetadata.AuthorizationEndpoint.Scheme != Uri.UriSchemeHttps)
244
+ {
245
+ throw new ArgumentException("AuthorizationEndpoint must use HTTP or HTTPS.", nameof(authServerMetadata));
246
+ }
247
+
248
var queryParams = HttpUtility.ParseQueryString(string.Empty);
249
queryParams["client_id"] = _clientId;
250
queryParams["redirect_uri"] = _redirectUri.ToString();
0 commit comments