-
Notifications
You must be signed in to change notification settings - Fork 76
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
Fix invalid credential error handling in authentication process #536
Conversation
Signed-off-by: Dainius Serplis <[email protected]>
Signed-off-by: Dainius Serplis <[email protected]>
44fb4b0
to
e1727a3
Compare
Signed-off-by: Dainius Serplis <[email protected]>
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.
LGTM!
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.
Thanks for fixing this!
Approved, with minor corrections.
Signed-off-by: Dainius Serplis <[email protected]>
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.
One suggestion for changelog.
…nto fix-auth-error
Signed-off-by: Dainius Serplis <[email protected]>
At the moment our SDK does not handle HTTP 401 (Unauthorized) error when authenticating to VCD. As a result, the user may get the illusion that he authenticated correctly, but subsequent code would return errors that don't make sense (see example below). This bug also appears for all consumers of this SDK (including Terraform provider VCD). This has already confused quite a few users and we ought to fix it.
Before When specifying invalid credentials, the user may get totally odd errors, such as:
After this fix - the user would immediately get such error and break further flow:
Two new tests are added to validate this behavior:
TestVCDClient_AuthenticateInvalidPassword
TestVCDClient_AuthenticateInvalidToken