Skip to content

Commit 395ac90

Browse files
authored
Switch to non obsolete API
1 parent 25181d8 commit 395ac90

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/Identity/ApiAuthorization.IdentityServer/src/Extensions/DefaultClientRequestParametersProvider.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
using System.Linq;
5-
using Duende.IdentityServer.Extensions;
5+
using Duende.IdentityServer.Services;
66
using Microsoft.AspNetCore.Http;
77
using Microsoft.Extensions.Options;
88

@@ -12,7 +12,8 @@ internal class DefaultClientRequestParametersProvider : IClientRequestParameters
1212
{
1313
public DefaultClientRequestParametersProvider(
1414
IAbsoluteUrlFactory urlFactory,
15-
IOptions<ApiAuthorizationOptions> options)
15+
IOptions<ApiAuthorizationOptions> options,
16+
IIssuerNameService nameService)
1617
{
1718
UrlFactory = urlFactory;
1819
Options = options;
@@ -22,10 +23,12 @@ public DefaultClientRequestParametersProvider(
2223

2324
public IOptions<ApiAuthorizationOptions> Options { get; }
2425

26+
public IIssuerNameService NameService { get; }
27+
2528
public IDictionary<string, string> GetClientParameters(HttpContext context, string clientId)
2629
{
2730
var client = Options.Value.Clients[clientId];
28-
var authority = context.GetIdentityServerIssuerUri();
31+
var authority = NameService.GetCurrentAsync().GetAwaiter().GetResult();
2932
if (!client.Properties.TryGetValue(ApplicationProfilesPropertyNames.Profile, out var type))
3033
{
3134
throw new InvalidOperationException($"Can't determine the type for the client '{clientId}'");

0 commit comments

Comments
 (0)