Skip to content

Commit

Permalink
Updated success message for MacOS
Browse files Browse the repository at this point in the history
  • Loading branch information
erwinvanhunen committed Nov 15, 2024
1 parent 49c4141 commit 255dc86
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/lib/PnP.Framework/AuthenticationManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ public AuthenticationManager(string clientId, string username, SecureString pass
this.username = username;
this.password = password;
publicClientApplication = builder.Build();

// register tokencache if callback provided
tokenCacheCallback?.Invoke(publicClientApplication.UserTokenCache);
authenticationType = ClientContextType.AzureADCredentials;
Expand Down Expand Up @@ -436,19 +436,19 @@ public AuthenticationManager(string clientId, string redirectUrl = null, string
Title = "Login with M365 PnP",
ListOperatingSystemAccounts = true,
};
builder = builder.WithBroker(brokerOptions).WithDefaultRedirectUri().WithParentActivityOrWindow(WindowHandleUtilities.GetConsoleOrTerminalWindow);
builder = builder.WithBroker(brokerOptions).WithDefaultRedirectUri().WithParentActivityOrWindow(WindowHandleUtilities.GetConsoleOrTerminalWindow);
}
else
{
if (!string.IsNullOrEmpty(redirectUrl))
{
builder = builder.WithRedirectUri(redirectUrl);
}
}
this.customWebUi = customWebUi;
}
builder.WithLegacyCacheCompatibility(false);
publicClientApplication = builder.Build();

// register tokencache if callback provided
tokenCacheCallback?.Invoke(publicClientApplication.UserTokenCache);

Expand Down Expand Up @@ -494,8 +494,8 @@ public AuthenticationManager(string clientId, string tenantId, Func<DeviceCodeRe

builder = builder.WithHttpClientFactory(HttpClientFactory);
builder.WithLegacyCacheCompatibility(false);
publicClientApplication = builder.Build();
publicClientApplication = builder.Build();

// register tokencache if callback provided
tokenCacheCallback?.Invoke(publicClientApplication.UserTokenCache);

Expand Down Expand Up @@ -838,8 +838,8 @@ public async Task<string> GetAccessTokenAsync(string[] scopes, CancellationToken
{
var options = new SystemWebViewOptions()
{
HtmlMessageError = "<p> An error occurred: {0}. Details {1}</p>",
HtmlMessageSuccess = "<p>Successfully acquired token. You may close this window now.</p>"
HtmlMessageError = "<p style=\"font-family: sans-serif; font-weight: bold; color: red\">An error occurred:</p><p style=\"color: black\">{0}. Details {1}</p>",
HtmlMessageSuccess = "<html><body><div style=\"display:table;background-color:#eee;width:100%\"><div style=\"padding:10px;float:left;font-family:sans-serif\"><div style=\"display:table;height:50px;width:50px;overflow:hidden;background-color:#4ec92f\"><div style=\"display:table-cell;vertical-align:middle;text-align:center;color:#fff\"><div><span style=\"font-size:40px\">&#x2713;</span></div></div></div></div><div style=\"color:#000;float:left;padding:10 0 0 10;vertical-align:text-top;font-family:sans-serif\"><span style=\"font-weight:700\">Successfully acquired token</span><p>You may close this window now.</p></div></div></body></html>"
};
builder = builder.WithUseEmbeddedWebView(false);
builder = builder.WithSystemWebViewOptions(options);
Expand Down Expand Up @@ -1024,8 +1024,8 @@ public async Task<ClientContext> GetContextAsync(string siteUrl, CancellationTok
{
var options = new SystemWebViewOptions()
{
HtmlMessageError = "<p> An error occurred: {0}. Details {1}</p>",
HtmlMessageSuccess = "<p>Succesfully acquired token. You may close this window now.</p>"
HtmlMessageError = "<p style=\"font-family: sans-serif; font-weight: bold; color: red\">An error occurred:</p><p style=\"color: black\">{0}. Details {1}</p>",
HtmlMessageSuccess = "<html><body><div style=\"display:table;background-color:#eee;width:100%\"><div style=\"padding:10px;float:left;font-family:sans-serif\"><div style=\"display:table;height:50px;width:50px;overflow:hidden;background-color:#4ec92f\"><div style=\"display:table-cell;vertical-align:middle;text-align:center;color:#fff\"><div><span style=\"font-size:40px\">&#x2713;</span></div></div></div></div><div style=\"color:#000;float:left;padding:10 0 0 10;vertical-align:text-top;font-family:sans-serif\"><span style=\"font-weight:700\">Successfully acquired token</span><p>You may close this window now.</p></div></div></body></html>"
};
builder = builder.WithUseEmbeddedWebView(false);
builder = builder.WithSystemWebViewOptions(options);
Expand Down

0 comments on commit 255dc86

Please sign in to comment.