Skip to content

Commit b1ca466

Browse files
gautamdshethGautam Sheth
andauthored
Improve interactive login messages for Azure AD app registration (#4991)
* Improve interactive login messages for Azure AD app registration * Fix clipboard text setting for device login in Azure AD app registration --------- Co-authored-by: Gautam Sheth <gautam.sheth@staffbase.com>
1 parent a49133a commit b1ca466

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Commands/AzureAD/RegisterAzureADApp.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ private void StartConsentFlow(string loginEndPoint, AzureADApp azureApp, string
660660
using (var authManager = AuthenticationManager.CreateWithDeviceLogin(azureApp.AppId, Tenant, (deviceCodeResult) =>
661661
{
662662
ClipboardService.SetText(deviceCodeResult.UserCode);
663-
messageWriter.LogWarning($"\n\nCode {deviceCodeResult.UserCode} has been copied to your clipboard and a new tab in the browser has been opened. Please paste this code in there and proceed.\n\n");
663+
Host.UI.WriteWarningLine($"\n\nPlease login.\n\nWe opened a browser and navigated to {deviceCodeResult.VerificationUrl}\n\nEnter code: {deviceCodeResult.UserCode} (we copied this code to your clipboard)\n\nNOTICE: close the browser tab after you authenticated successfully to continue the process.");
664664
BrowserHelper.OpenBrowserForInteractiveLogin(deviceCodeResult.VerificationUrl, BrowserHelper.FindFreeLocalhostRedirectUri(), cancellationTokenSource);
665665
return Task.FromResult(0);
666666
}, AzureEnvironment))

src/Commands/AzureAD/RegisterEntraIDAppForInteractiveLogin.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ private void StartConsentFlow(string loginEndPoint, AzureADApp azureApp, string
502502
using (var authManager = AuthenticationManager.CreateWithDeviceLogin(azureApp.AppId, Tenant, (deviceCodeResult) =>
503503
{
504504
ClipboardService.SetText(deviceCodeResult.UserCode);
505-
messageWriter.LogWarning($"\n\nCode {deviceCodeResult.UserCode} has been copied to your clipboard and a new tab in the browser has been opened. Please paste this code in there and proceed.\n\n");
505+
Host.UI.WriteWarningLine($"\n\nPlease login.\n\nWe opened a browser and navigated to {deviceCodeResult.VerificationUrl}\n\nEnter code: {deviceCodeResult.UserCode} (we copied this code to your clipboard)\n\nNOTICE: close the browser tab after you authenticated successfully to continue the process.");
506506
BrowserHelper.OpenBrowserForInteractiveLogin(deviceCodeResult.VerificationUrl, BrowserHelper.FindFreeLocalhostRedirectUri(), cancellationTokenSource);
507507
return Task.FromResult(0);
508508
}, AzureEnvironment))

0 commit comments

Comments
 (0)