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

Discourage IAuthorizationParametersMessageStore #1462

Merged
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 @@ -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