-
Notifications
You must be signed in to change notification settings - Fork 875
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
Added reset password dialog upon SQL Server expired password error #21295
Conversation
Added updated GIFs after changes |
I think 'Change Password' on server request/error number is not an uncommon scenario and can be extended beyond MSSQL provider. e.g. MySQL supports Password expiration which is something MySQL provider can make use of in future. |
Definitely, I wasn't saying that it wouldn't be useful. Just that it currently isn't doing that (we specifically check for MSSQL and only our specific error code). And if you're looking to make this extensible I would very much suggest looking at a much more generic way of doing this - for example having a generic way for providers to register a callback that is called when an error occurs during a connection. This would allow them to do whatever they needed without us needing to cover every single possible scenario in core ourselves. Example flow :
We could then still provide simple ways for users to accomplish common tasks - such as showing the firewall rule dialog or change password dialog (so that each extension doesn't have to re-implement it themselves). This could be done either through the extension API or by a package we provide that they can reference separately. |
src/sql/workbench/services/connection/browser/connectionDialogService.ts
Outdated
Show resolved
Hide resolved
src/sql/workbench/services/connection/browser/passwordChangeDialog.ts
Outdated
Show resolved
Hide resolved
src/sql/workbench/services/connection/browser/passwordChangeDialog.ts
Outdated
Show resolved
Hide resolved
src/sql/workbench/services/connection/browser/passwordChangeDialog.ts
Outdated
Show resolved
Hide resolved
@smartguest let's talk about the feedback in our meeting today. |
@Charles-Gagnon as discussed offline, we would take this feedback as a follow-up investigation activity as its the initial design limitation and not specific to the proposed changes. It would be ideal to address it altogether with other error codes too. |
Added updated dialog (shown in screenshot) and addressed feedback. Please review for merge this release (Additional functionality to dataprotocol API will be added as part of the next phase.) |
@smartguest I have a question about this comment in the updated screenshots (thank you for those): "First connect for an expired password (initial unexpected error happens on SSMS as well)" Do we know why that fails and can we handle it better? |
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.
For the password cannot be changed error... Do we have to include the "Changed database context to 'master'" and "Changed language setting to us_english" text? It doesn't seem relevant to the error, and is not helpful for users.
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.
Other than some minor changes, looks good.
src/sql/workbench/services/connection/browser/passwordChangeDialog.ts
Outdated
Show resolved
Hide resolved
src/sql/workbench/services/connection/browser/passwordChangeDialog.ts
Outdated
Show resolved
Hide resolved
src/sql/workbench/services/connection/browser/connectionDialogService.ts
Show resolved
Hide resolved
@erinstellato-ms The first connect error happens when you attempt to connect to a server using credentials for the first time, the exact error is: "A connection was successfully established with the server, but then an error occurred during the login process. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.)" This will have to be a separate issue to be looked into as it also happens with SSMS so it's not really part of this PR. Also those messages are part of the SqlClient error message as it is. I added a filter to remove them |
@smartguest This PR depends on both the STS changes and (to a slightly lesser extent) the dataprocol-client changes. You typically should be including all required changes together in a single PR so we don't have broken features in ADS - which normally means waiting until a build of STS is published that contain the required changes. (and a new release of dataprotocol-client should be done as well) |
It is merged but has it already been included at least in the insider version? Yesterday it expired and I did not get the pop up although it is possible that I did not have the latest build, now I have version 1.42.0-insider, yesterday I may have had the previous one |
I'm still seeing this in version 1.48.0 in 2024. Every time I create a new user who uses Azure Data Studio with "User must change password at next login" , we have to have them use a desktop w/ SSMS to change their password. |
@smartguest can you re-test this in ADS 1.48 when you have a minute? Thanks. @kisantia for awareness. |
@erinstellato It works for error 18488 (The one for user must change password at next login and it should work for error 18487, which is the password expired error as addressed in this PR: #22916). Can you get the exact error details from the "Copy Details" button when it happens? @rick-syncbak and paste it here? I need to identify to see if the error you are encountering matches the error code for expired password that we currently check for). Also is this a cloud instance or a local SQL Server instance? Currently password reset is only supported on non-cloud SQL Server instances. If the error is a "no process at the other end of the pipe" error, that is a temporary error that is unrelated and can be retried a couple of times to get it working. |
I was able to test successfully on a "must change password on first login"
scenario.
Thank you!
…On Tue, Mar 26, 2024 at 5:03 PM Alex Ma ***@***.***> wrote:
@erinstellato <https://github.com/erinstellato> It works for error 18488
(The one that states password needs to be changed and it should work for
error 18487, which is the password expired error as addressed in this PR):
#22916 <#22916>).
Can you get the exact error from the "Copy Details" button when it
happens? @rick-syncbak <https://github.com/rick-syncbak> and paste it
here? I need to identify to see if the error you are encountering matches
the error code that we currently check for).
—
Reply to this email directly, view it on GitHub
<#21295 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABRRCEWTMCTKV5KJDTGXFXDY2HWDFAVCNFSM6AAAAAASIMCY32VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRRGU2DQMRWHE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@rick-syncbak Thanks for following up, glad it's working for you! Thanks @smartguest for validating and sharing the video! |
This PR adds in a simple reset dialog that pops up whenever a password expired error is encountered while connecting to a profile.
The user can press OK to change the password (and connect to the server and save the password immediately if enabled).
If an error is returned from STS when attempting to change the password, users will need to try connecting again to bring the dialog again so they can enter a different password.
Redesigned password reset dialog:
Removed unnecessary dialog in error:
First connect for an expired password (initial unexpected error happens on SSMS as well):
Error for an invalid password (error from STS):
Loading spinner and successful connect for a valid password:
This PR fixes #605
Companion PRS:
microsoft/sqlops-dataprotocolclient#71
microsoft/sqltoolsservice#1771