diff --git a/CommunityToolkit.Authentication.Uwp/WebAccountProviderConfig.cs b/CommunityToolkit.Authentication.Uwp/WebAccountProviderConfig.cs
index 9747d97..8acb939 100644
--- a/CommunityToolkit.Authentication.Uwp/WebAccountProviderConfig.cs
+++ b/CommunityToolkit.Authentication.Uwp/WebAccountProviderConfig.cs
@@ -2,6 +2,8 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+using System.Collections.Generic;
+
namespace CommunityToolkit.Authentication
{
///
@@ -19,6 +21,16 @@ public struct WebAccountProviderConfig
///
public WebAccountProviderType WebAccountProviderType { get; set; }
+ ///
+ /// Gets or sets the properties that need to be added when constructing (for MSA).
+ ///
+ public IDictionary MSATokenRequestProperties { get; set; }
+
+ ///
+ /// Gets or sets the properties that need to be added when constructing (for AAD).
+ ///
+ public IDictionary AADTokenRequestProperties { get; set; }
+
///
/// Initializes a new instance of the struct.
///
@@ -28,6 +40,8 @@ public WebAccountProviderConfig(WebAccountProviderType webAccountProviderType, s
{
WebAccountProviderType = webAccountProviderType;
ClientId = clientId;
+ MSATokenRequestProperties = new Dictionary();
+ AADTokenRequestProperties = new Dictionary();
}
}
}
diff --git a/CommunityToolkit.Authentication.Uwp/WindowsProvider.cs b/CommunityToolkit.Authentication.Uwp/WindowsProvider.cs
index 234521f..ed2d89b 100644
--- a/CommunityToolkit.Authentication.Uwp/WindowsProvider.cs
+++ b/CommunityToolkit.Authentication.Uwp/WindowsProvider.cs
@@ -33,7 +33,7 @@ public class WindowsProvider : BaseProvider
private const string SettingsKeyProviderId = "WindowsProvider_ProviderId";
private const string SettingsKeyProviderAuthority = "WindowsProvider_Authority";
- private static readonly SemaphoreSlim SemaphoreSlim = new (1);
+ private static readonly SemaphoreSlim SemaphoreSlim = new(1);
// Default/minimal scopes for authentication, if none are provided.
private static readonly string[] DefaultScopes = { "User.Read" };
@@ -550,6 +550,20 @@ private WebTokenRequest GetWebTokenRequest(WebAccountProvider provider, string c
: new WebTokenRequest(provider, scopesString, clientId);
webTokenRequest.Properties.Add(GraphResourcePropertyKey, GraphResourcePropertyValue);
+ if (provider.Authority == MicrosoftAccountAuthority)
+ {
+ foreach (var property in _webAccountProviderConfig.MSATokenRequestProperties)
+ {
+ webTokenRequest.Properties.Add(property);
+ }
+ }
+ else if (provider.Authority == AadAuthority)
+ {
+ foreach (var property in _webAccountProviderConfig.AADTokenRequestProperties)
+ {
+ webTokenRequest.Properties.Add(property);
+ }
+ }
return webTokenRequest;
}