Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
d36ef91
Adding WindowsProvider project
shweaver-MSFT Mar 25, 2021
b288250
Added WindowsProvider to sampleTest
shweaver-MSFT Mar 25, 2021
d7a804a
Refactor, currently works with MSA
shweaver-MSFT Apr 1, 2021
a4801f7
Tweaks to method order
shweaver-MSFT Apr 1, 2021
1c58e6c
Added TryLoginSilentAsync method
shweaver-MSFT Apr 2, 2021
968977f
Updates
shweaver-MSFT Apr 2, 2021
cad9452
Manual merge in dev
shweaver-MSFT Apr 2, 2021
080b9f2
Removed empty line
shweaver-MSFT Apr 2, 2021
9d22f6e
Added configuration options for the AccountsSettingsPane
shweaver-MSFT Apr 6, 2021
0720924
Fixed pane cancellation in WindowsProvider
shweaver-MSFT Apr 6, 2021
50027e4
Updates to sample
shweaver-MSFT Apr 6, 2021
aa20585
adjusting provider creation
shweaver-MSFT Apr 6, 2021
73f914c
Merge branch 'dev' into shweaver/windows-provider2
shweaver-MSFT Apr 6, 2021
f85e655
tweaks and comments
shweaver-MSFT Apr 6, 2021
cf6c10b
Merge branch 'shweaver/windows-provider2' of https://github.com/windo…
shweaver-MSFT Apr 6, 2021
89d913c
Exposed GetTokenAsync method
shweaver-MSFT Apr 6, 2021
3ff40f2
Removed hooks for AAD login, which was broken anyway
shweaver-MSFT Apr 6, 2021
ff3f48b
Adding WindowsProvider tests
shweaver-MSFT Apr 7, 2021
2790966
Added more comments and adjusted function naming
shweaver-MSFT Apr 7, 2021
550fb6b
Added docs
shweaver-MSFT Apr 7, 2021
73df927
Working test!
shweaver-MSFT Apr 8, 2021
6e95272
minor tweak to enable empty client id. Good for ultra basic auth, wit…
shweaver-MSFT Apr 8, 2021
61f9664
PR updates
shweaver-MSFT Apr 12, 2021
0293e32
Added constructor to WebAccountProviderConfig
shweaver-MSFT Apr 13, 2021
12fa2bd
Updated docs removed unused redirect uri
shweaver-MSFT Apr 13, 2021
6d84920
Updated docs with latest guidance
shweaver-MSFT Apr 14, 2021
af0507a
Removed uneccesary client id from WindowsProvider tests
shweaver-MSFT Apr 15, 2021
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
8 changes: 6 additions & 2 deletions CommunityToolkit.Net.Authentication.Msal/MsalProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ public class MsalProvider : BaseProvider
/// <param name="clientId">Registered ClientId.</param>
/// <param name="redirectUri">RedirectUri for auth response.</param>
/// <param name="scopes">List of Scopes to initially request.</param>
public MsalProvider(string clientId, string[] scopes = null, string redirectUri = "https://login.microsoftonline.com/common/oauth2/nativeclient")
/// <param name="autoSignIn">Determines whether the provider attempts to silently log in upon instantionation.</param>
public MsalProvider(string clientId, string[] scopes = null, string redirectUri = "https://login.microsoftonline.com/common/oauth2/nativeclient", bool autoSignIn = true)
{
var client = PublicClientApplicationBuilder.Create(clientId)
.WithAuthority(AzureCloudInstance.AzurePublic, AadAuthorityAudience.AzureAdAndPersonalMicrosoftAccount)
Expand All @@ -47,7 +48,10 @@ public MsalProvider(string clientId, string[] scopes = null, string redirectUri

Client = client;

_ = TrySilentSignInAsync();
if (autoSignIn)
{
Task.Run(TrySilentSignInAsync);
}
}

/// <inheritdoc/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<Project Sdk="MSBuild.Sdk.Extras">

<PropertyGroup>
<TargetFramework>uap10.0.17763</TargetFramework>
<Title>Windows Community Toolkit Graph Uwp Authentication Provider</Title>
<PackageId>CommunityToolkit.Uwp.Authentication</PackageId>
<Description>
This library provides an authentication provider based on the native Windows dialogues. It is part of the Windows Community Toolkit.

Classes:
- WindowsProvider:
</Description>
<PackageTags>UWP Toolkit Windows Microsoft Graph AadLogin Authentication Login</PackageTags>
<SignAssembly>false</SignAssembly>
<GenerateLibraryLayout>true</GenerateLibraryLayout>
<LangVersion>8.0</LangVersion>
<Configurations>Debug;Release;CI</Configurations>
<Platforms>AnyCPU;ARM;ARM64;x64;x86</Platforms>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\CommunityToolkit.Net.Authentication\CommunityToolkit.Net.Authentication.csproj" />
</ItemGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'uap10.0.17763'">
<DefineConstants Condition="'$(DisableImplicitFrameworkDefines)' != 'true'">$(DefineConstants);WINRT</DefineConstants>
</PropertyGroup>

<Import Project="$(MSBuildSDKExtrasTargets)" Condition="Exists('$(MSBuildSDKExtrasTargets)')" />
<!-- https://weblogs.asp.net/rweigelt/disable-warnings-in-generated-c-files-of-uwp-app -->
<Target Name="PragmaWarningDisablePrefixer" AfterTargets="MarkupCompilePass2">
<ItemGroup>
<GeneratedCSFiles Include="**\*.g.cs;**\*.g.i.cs" />
</ItemGroup>
<Message Text="CSFiles: @(GeneratedCSFiles->'&quot;%(Identity)&quot;')" />
<Exec Command="for %%f in (@(GeneratedCSFiles->'&quot;%(Identity)&quot;')) do echo #pragma warning disable &gt; %%f.temp &amp;&amp; type %%f &gt;&gt; %%f.temp &amp;&amp; move /y %%f.temp %%f &gt; NUL" />
</Target>
</Project>
Loading