Skip to content

Commit

Permalink
Merge pull request #121 from Azure-Samples/jennyf/msal4.9
Browse files Browse the repository at this point in the history
Jennyf/msal4.9
  • Loading branch information
trwalke authored Mar 6, 2020
2 parents 5db1754 + 0586bc3 commit 11fb449
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public async Task<UserContext> SignInAsync()
try
{
// acquire token silent
newContext = await AcquireToken();
newContext = await AcquireTokenSilent();
}
catch (MsalUiRequiredException)
{
Expand All @@ -61,11 +61,11 @@ public async Task<UserContext> SignInAsync()
return newContext;
}

private async Task<UserContext> AcquireToken()
private async Task<UserContext> AcquireTokenSilent()
{
IEnumerable<IAccount> accounts = await _pca.GetAccountsAsync();
AuthenticationResult authResult = await _pca.AcquireTokenSilent(B2CConstants.Scopes, GetAccountByPolicy(accounts, B2CConstants.PolicySignUpSignIn))
.WithB2CAuthority(B2CConstants.AuthoritySignInSignUp)
.WithB2CAuthority(B2CConstants.AuthoritySignInSignUp)
.ExecuteAsync();

var newContext = UpdateUserInfo(authResult);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
<PackageReference Include="System.Net.Http" Version="4.3.3" />
<PackageReference Include="Xamarin.Forms" Version="3.0.0.530893" />
<PackageReference Include="Microsoft.Identity.Client" Version="4.8.2" />
<PackageReference Include="Microsoft.Identity.Client" Version="4.9.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
<ItemGroup>
<Reference Include="Java.Interop" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.Identity.Client, Version=4.8.2.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.Identity.Client.4.8.2\lib\monoandroid90\Microsoft.Identity.Client.dll</HintPath>
<Reference Include="Microsoft.Identity.Client, Version=4.9.0.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.Identity.Client.4.9.0\lib\monoandroid90\Microsoft.Identity.Client.dll</HintPath>
</Reference>
<Reference Include="Mono.Android" />
<Reference Include="mscorlib" />
Expand Down
2 changes: 1 addition & 1 deletion UserDetailsClient/UserDetailsClient.Droid/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<packages>
<package id="AsyncUsageAnalyzers" version="1.0.0-alpha003" targetFramework="monoandroid81" developmentDependency="true" />
<package id="Microsoft.CSharp" version="4.5.0" targetFramework="monoandroid81" />
<package id="Microsoft.Identity.Client" version="4.8.2" targetFramework="monoandroid90" />
<package id="Microsoft.Identity.Client" version="4.9.0" targetFramework="monoandroid90" />
<package id="Microsoft.NETCore.Platforms" version="2.1.0" targetFramework="monoandroid81" />
<package id="Microsoft.NETCore.Targets" version="1.1.3" targetFramework="monoandroid90" />
<package id="Microsoft.Win32.Primitives" version="4.3.0" targetFramework="monoandroid60" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Identity.Client">
<Version>4.8.2</Version>
<Version>4.9.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
<Version>6.1.4</Version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.Identity.Client, Version=4.8.2.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.Identity.Client.4.8.2\lib\xamarinios10\Microsoft.Identity.Client.dll</HintPath>
<Reference Include="Microsoft.Identity.Client, Version=4.9.0.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.Identity.Client.4.9.0\lib\xamarinios10\Microsoft.Identity.Client.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.IdentityModel" />
Expand Down
1 change: 1 addition & 0 deletions UserDetailsClient/UserDetailsClient.iOS/packages.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="AsyncUsageAnalyzers" version="1.0.0-alpha003" targetFramework="xamarinios10" developmentDependency="true" />
<package id="Microsoft.Identity.Client" version="4.9.0" targetFramework="xamarinios10" />
<package id="Microsoft.CSharp" version="4.5.0" targetFramework="xamarinios10" />
<package id="Microsoft.NETCore.Platforms" version="1.1.1" targetFramework="xamarinios10" />
<package id="Microsoft.NETCore.Targets" version="1.1.3" targetFramework="xamarinios10" />
Expand Down

0 comments on commit 11fb449

Please sign in to comment.