Skip to content

Commit

Permalink
reword the warning message
Browse files Browse the repository at this point in the history
  • Loading branch information
gord5500 committed Sep 24, 2024
1 parent 7063367 commit 521a53f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/D2L.Bmx/OktaAuthenticator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ bool bypassBrowserSecurity
if( hasElevatedPermissions && !bypassBrowserSecurity ) {
consoleWriter.WriteWarning( $"""
BMX is being run with elevated privileges and is unable to automatically sign in to Okta.
If you have to run BMX with elevated privileges, and aren't concerned with the security of {orgUrl.Host},
consider running the command again with the '--experimental-bypass-browser-security' flag.
If you want to automatically sign in, and aren't concerned with the security of {orgUrl.Host},
consider using '--experimental-bypass-browser-security' flag.
"""
);
return null;
Expand Down Expand Up @@ -193,7 +193,7 @@ async Task GetSessionCookieAsync() {
await page.GoToAsync( orgUrl.AbsoluteUri ).WaitAsync( cancellationTokenSource.Token );
} else {
consoleWriter.WriteWarning(
"WARNING: Failed to authenticate with Okta when trying to automatically sign in" );
"Failed to authenticate with Okta when trying to automatically sign in" );
sessionIdTcs.SetResult( null );
}
return;
Expand All @@ -206,21 +206,21 @@ async Task GetSessionCookieAsync() {
}
} catch( TaskCanceledException ) {
consoleWriter.WriteWarning( $"""
WARNING: Timed out when trying to automatically sign in to Okta. Check if the org '{orgUrl}' is correct.
Timed out when trying to automatically sign in to Okta. Check if the org '{orgUrl}' is correct.
If you have to run BMX with elevated privileges, and aren't concerned with the security of {orgUrl.Host},
consider running the command again with the '--experimental-bypass-browser-security' flag.
"""
);
} catch( TargetClosedException ) {
consoleWriter.WriteWarning( """
WARNING: Failed to automatically sign in to Okta as BMX is likely being run with elevated privileges.
Failed to automatically sign in to Okta as BMX is likely being run with elevated privileges.
If you have to run BMX with elevated privileges, and aren't concerned with the security of {orgUrl.Host},
consider running the command again with the '--experimental-bypass-browser-security' flag.
"""
);
} catch( Exception ) {
consoleWriter.WriteWarning(
"WARNING: Unknown error occurred while trying to automatically sign in with Okta." );
"Unknown error occurred while trying to automatically sign in with Okta." );
}

if( sessionId is null ) {
Expand All @@ -233,7 +233,7 @@ consider running the command again with the '--experimental-bypass-browser-secur
string providedLogin = user.Split( "@" )[0];
if( !sessionLogin.Equals( providedLogin, StringComparison.OrdinalIgnoreCase ) ) {
consoleWriter.WriteWarning(
"WARNING: Could not automatically sign in to Okta as provided Okta user "
"Could not automatically sign in to Okta as provided Okta user "
+ $"'{sessionLogin}' does not match user '{providedLogin}'." );
return null;
}
Expand Down

0 comments on commit 521a53f

Please sign in to comment.