Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return invalid_request when no response_type is provided #1423

Merged
merged 1 commit into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ private AuthorizeRequestValidationResult ValidateCoreParameters(ValidatedAuthori
if (responseType.IsMissing())
{
LogError("Missing response_type", request);
return Invalid(request, OidcConstants.AuthorizeErrors.UnsupportedResponseType, "Missing response_type");
return Invalid(request, OidcConstants.AuthorizeErrors.InvalidRequest, "Missing response_type");
}

// The responseType may come in in an unconventional order.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Duende Software. All rights reserved.
// Copyright (c) Duende Software. All rights reserved.
// See LICENSE in the project root for license information.


Expand All @@ -10,6 +10,7 @@
using Duende.IdentityServer.Models;
using Duende.IdentityServer.Test;
using FluentAssertions;
using IdentityModel;
using IntegrationTests.Common;
using Xunit;

Expand Down Expand Up @@ -111,6 +112,6 @@ public async Task Request_missing_response_type_rejected()
_mockPipeline.BrowserClient.AllowAutoRedirect = true;
var response = await _mockPipeline.BrowserClient.GetAsync(url);

_mockPipeline.ErrorMessage.Error.Should().Be("unsupported_response_type");
_mockPipeline.ErrorMessage.Error.Should().Be(OidcConstants.AuthorizeErrors.InvalidRequest);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ public async Task Missing_ResponseType()
var result = await validator.ValidateAsync(parameters);

result.IsError.Should().BeTrue();
result.Error.Should().Be(OidcConstants.AuthorizeErrors.UnsupportedResponseType);
result.Error.Should().Be(OidcConstants.AuthorizeErrors.InvalidRequest);
}

[Fact]
Expand Down