Skip to content

Commit 7f305ac

Browse files
committed
Add some comments to help out the novice users out there.
1 parent 66da351 commit 7f305ac

1 file changed

Lines changed: 28 additions & 3 deletions

File tree

active-directory-b2c-wpf/App.xaml.cs

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,41 @@ namespace active_directory_b2c_wpf
1414
/// </summary>
1515
public partial class App : Application
1616
{
17-
private static readonly string Tenant = "fabrikamb2c.onmicrosoft.com";
18-
private static readonly string AzureAdB2CHostname = "fabrikamb2c.b2clogin.com";
17+
/// <summary>
18+
/// B2C tenant name
19+
/// </summary>
20+
private static readonly string TenantName = "fabrikamb2c";
21+
private static readonly string Tenant = $"{TenantName}.onmicrosoft.com";
22+
private static readonly string AzureAdB2CHostname = $"{TenantName}.b2clogin.com";
23+
24+
/// <summary>
25+
/// ClientId for the application which initiates the login functionality (this app)
26+
/// </summary>
1927
private static readonly string ClientId = "841e1190-d73a-450c-9d68-f5cf16b78e81";
28+
29+
/// <summary>
30+
/// Should be one of the choices on the Azure AD B2c / App(Keten) / Authentication blade
31+
/// </summary>
2032
private static readonly string RedirectUri = "https://fabrikamb2c.b2clogin.com/oauth2/nativeclient";
33+
34+
/// <summary>
35+
/// From Azure AD B2C / UserFlows blade
36+
/// </summary>
2137
public static string PolicySignUpSignIn = "b2c_1_susi";
2238
public static string PolicyEditProfile = "b2c_1_edit_profile";
2339
public static string PolicyResetPassword = "b2c_1_reset";
2440

41+
/// <summary>
42+
/// Note: AcquireTokenInteractive will fail to get the AccessToken if "Admin Consent" has not been granted to this scope:
43+
/// </summary>
2544
public static string[] ApiScopes = { "https://fabrikamb2c.onmicrosoft.com/helloapi/demo.read" };
45+
46+
/// <summary>
47+
/// URL for API which will receive the bearer token corresponding to this authentication
48+
/// </summary>
2649
public static string ApiEndpoint = "https://fabrikamb2chello.azurewebsites.net/hello";
50+
51+
// Shouldn't need to change these:
2752
private static string AuthorityBase = $"https://{AzureAdB2CHostname}/tfp/{Tenant}/";
2853
public static string AuthoritySignUpSignIn = $"{AuthorityBase}{PolicySignUpSignIn}";
2954
public static string AuthorityEditProfile = $"{AuthorityBase}{PolicyEditProfile}";
@@ -36,7 +61,7 @@ static App()
3661
PublicClientApp = PublicClientApplicationBuilder.Create(ClientId)
3762
.WithB2CAuthority(AuthoritySignUpSignIn)
3863
.WithRedirectUri(RedirectUri)
39-
.WithLogging(Log, LogLevel.Info, false) // don't log PII details on a regular basis
64+
.WithLogging(Log, LogLevel.Info, false) // don't log P(ersonally) I(dentifiable) I(nformation) details on a regular basis
4065
.Build();
4166

4267
TokenCacheHelper.Bind(PublicClientApp.UserTokenCache);

0 commit comments

Comments
 (0)