Skip to content

Commit

Permalink
Merge pull request #1462 from DuendeSoftware/joe/cleanup-validated-au…
Browse files Browse the repository at this point in the history
…thorize-request-extensions

Discourage IAuthorizationParametersMessageStore
  • Loading branch information
brockallen authored Nov 7, 2023
2 parents d2facdc + de07d8c commit 8eb790c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,7 @@ public static IHttpClientBuilder AddJwtRequestUriHttpClient(this IIdentityServer
/// <typeparam name="T"></typeparam>
/// <param name="builder">The builder.</param>
/// <returns></returns>
[Obsolete("This feature is deprecated. Consider using Pushed Authorization Requests instead.")]
public static IIdentityServerBuilder AddAuthorizationParametersMessageStore<T>(this IIdentityServerBuilder builder)
where T : class, IAuthorizationParametersMessageStore
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,12 @@ public async Task WriteHttpResponse(AuthorizeInteractionPageResult result, HttpC
{
var returnUrl = _urls.BasePath.EnsureTrailingSlash() + ProtocolRoutePaths.AuthorizeCallback;

// IAuthorizationParametersMessageStore is deprecated and will be removed someday
if (_authorizationParametersMessageStore != null)
{
#pragma warning disable CS0618 // Type or member is obsolete
var msg = new Message<IDictionary<string, string[]>>(result.Request.ToOptimizedFullDictionary());
#pragma warning restore CS0618 // Type or member is obsolete
var id = await _authorizationParametersMessageStore.WriteAsync(msg);
returnUrl = returnUrl.AddQueryString(Constants.AuthorizationParamsStore.MessageStoreIdParameterName, id);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ public static string ToOptimizedQueryString(this ValidatedAuthorizeRequest reque
return request.ToOptimizedRawValues().ToQueryString();
}

[Obsolete("This method is obsolete and will be removed in a future version.")]
public static IDictionary<string, string[]> ToOptimizedFullDictionary(this ValidatedAuthorizeRequest request)
{
return request.ToOptimizedRawValues().ToFullDictionary();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// See LICENSE in the project root for license information.


using System;
using Duende.IdentityServer.Validation;
using IdentityModel;
using Xunit;
Expand Down Expand Up @@ -29,6 +30,7 @@ public void GetAcrValues_should_return_snapshot_of_values()
}

[Fact]
[Obsolete]
public void ToOptimizedFullDictionary_should_return_dictionary_with_array_for_repeated_keys_when_request_objects_are_used()
{
var request = new ValidatedAuthorizeRequest()
Expand Down

0 comments on commit 8eb790c

Please sign in to comment.