sassoftware / vscode-sas-extension

This SAS Extension for Visual Studio Code provides support for the SAS language, including features such as SAS syntax highlighting, code completion, hover help, code folding, outline, SAS code snippets and run SAS code.
https://sassoftware.github.io/vscode-sas-extension/
Apache License 2.0
121 stars 48 forks source link

Unable to authenticate if you've already logged into SAS Studio #131

Closed Becky-Williamson closed 1 year ago

Becky-Williamson commented 1 year ago

Steps to reproduce:

  1. Set up profiles in VSC to two different servers. Note which server is displayed at the bottom of the VSC window. (I have profiles for both mwf.seagull-m1.unx.sas.com and tth.seagull-m1.unx.sas.com. TTH is the one at the bottom of the VSC window.)
  2. Close VSC.
  3. Start SAS Studio and connect to the server that was NOT displayed at the bottom of the VSC window. (In my case, MWF)
  4. Open VSC and change the profile to the one that you just connected to with SAS Studio by clicking on profile name and selecting the other profile from the selection list.
  5. Open the SAS tab and click Sign In
  6. Answer Allow to message that says "The extension 'SAS' wants to sign in using SAS.
  7. Answer Open to the message that says "Do you want Code to open the external website?"

Expected results: I'm not sure what should happen here. I am already logged in so it doesn't make sense to sign in again.

Actual results: The SAS Logon Manager tab opens in the browser with a message that says "You have signed in" and a Sign out button. If I go back to VSC and hit escape to cancel the authorization code box, the box closes, but the Sign In button is inactive and I can't get it to come back without closing VSC and reopening it.

scnwwu commented 1 year ago

I didn't reproduce it. If I already signed in to SAS Studio, the SASLogon will directly display the authorization code to me. However, I do think there's an issue to #57. As Becky described, if user cancel the authorization code box, means the user cancelled the Sign in process, the Sign in button should become active again. @scottdover

Becky-Williamson commented 1 year ago

I can reproduce this every time. I'd be happy to demonstrate what I'm seeing if anyone would like to see it.

scottdover commented 1 year ago

Hey @Becky-Williamson . I'm wondering if you can reproduce this using the run code button (in the main branch of code) instead of the sign in button?

Becky-Williamson commented 1 year ago

@scottdover, no, I can't reproduce it using the run code button. It seems to only happen with the Sign in button.

scottdover commented 1 year ago

Hmm. I just checked it on main following the above and was able to reproduce using the run code button and the steps above.

My hunch is that there are two issues. One is present on main, and has something to do with the recent auth provider changes. The other (the inactive sign in button), I can address in my current set of changes.

Becky-Williamson commented 1 year ago

@scottdover, I apologize. I can reproduce with the run button. I don't know if I left out a step last time but I just tried it again and I was able to reproduce it.

scottdover commented 1 year ago

It also seems like auth isn't working as expected since the new changes have made their way on to the mwf/tth images. At the moment, if you click Authorize Access (see screenshot), things don't redirect and the auth code box isn't dismissed/populated in vscode

Screenshot 2023-02-21 at 9 38 30 AM

scnwwu commented 1 year ago

@Becky-Williamson, would you help try below to help isolate the problem? I know there's a issue with Chrome/Edge. Would you try click the "Copy" instead of the "Open" for the message "Do you want Code to open the external website?", then paste the URL to Firefox to proceed. And for the screen shot Scott posted above, check any checkbox before Authorize Access. Thanks.

Becky-Williamson commented 1 year ago

If I copy the URL into Firefox it does automatically authenticate, both with the run button and the Sign In button.

scnwwu commented 1 year ago

The server has been reverted. Not a problem now.