Skip to content

Commit d35ba23

Browse files
authored
chore: updates to msal sso sample (#2526)
1 parent 44ed5bd commit d35ba23

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

packages/providers/mgt-msal2-provider/src/Msal2Provider.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,15 @@ export class Msal2Provider extends IProvider {
318318
return this.isMultipleAccountEnabled;
319319
}
320320

321-
private sessionStorageRequestedScopesKey = 'mgt-requested-scopes';
322-
private sessionStorageDeniedScopesKey = 'mgt-denied-scopes';
323-
private homeAccountKey = '275f3731-e4a4-468a-bf9c-baca24b31e26';
321+
private get sessionStorageRequestedScopesKey() {
322+
return 'mgt-requested-scopes';
323+
}
324+
private get sessionStorageDeniedScopesKey() {
325+
return 'mgt-denied-scopes';
326+
}
327+
private get homeAccountKey() {
328+
return '275f3731-e4a4-468a-bf9c-baca24b31e26';
329+
}
324330

325331
public constructor(config: Msal2Config | Msal2PublicClientApplicationConfig) {
326332
super();
@@ -398,6 +404,7 @@ export class Msal2Provider extends IProvider {
398404
await this.trySilentSignIn();
399405
}
400406
} catch (e) {
407+
console.error('🦒: Problem attempting to sign in', e);
401408
throw e;
402409
}
403410
}
@@ -717,6 +724,7 @@ export class Msal2Provider extends IProvider {
717724
const response = await this._publicClientApplication.acquireTokenPopup(accessTokenRequest);
718725
return response.accessToken;
719726
} catch (popUpErr) {
727+
console.error('🦒: problem with pop-up sign in', popUpErr);
720728
throw popUpErr;
721729
}
722730
}

samples/msal2provider-asp-net-core-sso/Pages/Shared/_Layout.cshtml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212

1313
@if (User.Identity.IsAuthenticated)
1414
{
15-
<script src="https://unpkg.com/@@microsoft/mgt@2/dist/bundle/mgt-loader.js"></script>
15+
<!-- <script src="https://unpkg.com/@@microsoft/[email protected]/dist/bundle/mgt-loader.js"></script> -->
16+
<!-- if v3 is not yet published then use the above line -->
17+
<script src="https://unpkg.com/@@microsoft/mgt@3/dist/bundle/mgt-loader.js"></script>
1618
<script>
1719
mgt.Providers.globalProvider = new mgt.Msal2Provider({
1820
clientId: "@Configuration["AzureAd:ClientId"]",

samples/msal2provider-asp-net-core-sso/mgt_sso.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net5.0</TargetFramework>
4+
<TargetFramework>net7.0</TargetFramework>
55
<UserSecretsId>aspnet-mgt_sso-FC64487B-1465-4E73-8AC6-CA78BD16A1B0</UserSecretsId>
66
<RootNamespace>mgt_sso</RootNamespace>
77
</PropertyGroup>

0 commit comments

Comments
 (0)