-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
display okta user and org in password prompt / failed auth error message #451
Conversation
src/D2L.Bmx/Okta/OktaApi.cs
Outdated
@@ -23,15 +23,18 @@ internal interface IOktaApi { | |||
internal class OktaApi : IOktaApi { | |||
private readonly CookieContainer _cookieContainer; | |||
private readonly HttpClient _httpClient; | |||
private string organization = string.Empty; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't initialize things to invalid non-null values just so we can mark things as non-nullable and skip null checks.
Nullables are good. Forced null checks are good. That's the compiler helping us avoid null errors.
False non-null values are much worse.
also - we name private fields with an underscore
private string organization = string.Empty; | |
private string? _organization; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea that's fair. I saw we couldn't reach the exception without having that value set already but I can see the reasoning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
related - https://desire2learn.atlassian.net/browse/VUL-104 this should help
Co-authored-by: Chenfeng Bao <[email protected]>
Why
Potential for the config file to have bad user / org values and it's not immediately obvious to the user that those could be the reason for their okta auth failing. This can happen with our internal install script when running wsl and the user gets set to 'root' in the config file.
Ticket
VUL-330