Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Scope property mapping in GetOpenIdConnectConfigurationAsync #45

Closed
wants to merge 1 commit into from
Closed
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
@@ -1,6 +1,7 @@
// Copyright (c) Brock Allen & Dominick Baier. All rights reserved.
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.

using System.Collections.Generic;
using System.Net.Http;

namespace Duende.AccessTokenManagement.OpenIdConnect;
Expand Down Expand Up @@ -44,4 +45,9 @@ public class OpenIdConnectClientConfiguration
/// The scheme name of the OIDC handler
/// </summary>
public string? Scheme { get; set; }

/// <summary>
/// Gets the list of permissions to request.
/// </summary>
public ICollection<string> Scope { get; set; } = new HashSet<string>();
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ public async Task<OpenIdConnectClientConfiguration> GetOpenIdConnectConfiguratio
ClientId = options.ClientId,
ClientSecret = options.ClientSecret,
HttpClient = options.Backchannel,

Scope = options.Scope
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ public async Task<UserToken> RefreshAccessTokenAsync(
ClientId = oidc.ClientId!,
ClientSecret = oidc.ClientSecret,
ClientCredentialStyle = _options.ClientCredentialStyle,

Scope = string.Join(" ", oidc.Scope),

RefreshToken = refreshToken
};

Expand Down
Loading