Skip to content
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 redirect paths and enable authentication and new dashboard by default #6605

Merged
merged 14 commits into from
May 11, 2023

Conversation

somebody1234
Copy link
Contributor

Pull Request Description

Sets production redirect URL to localhost:8080. This would break cloud.enso.org, but I believe there are no plans to upload the new dashboard to cloud.enso.org in the near future, so this should be acceptable for the time being

Important Notes

None

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • The documentation has been updated, if necessary.
  • Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.
  • All code follows the
    Scala,
    Java,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • All code has been tested:
    • Unit tests have been written where possible.
    • If GUI codebase was changed, the GUI was tested when built using ./run ide build.

@somebody1234 somebody1234 added the CI: No changelog needed Do not require a changelog entry for this PR. label May 9, 2023
@@ -17,7 +17,7 @@ const CLOUD_REDIRECTS = {
* when it is created. In the native app, the port is unpredictable, but this is not a problem
* because the native app does not use port-based redirects, but deep links. */
development: newtype.asNewtype<auth.OAuthRedirect>('http://localhost:8081'),
production: newtype.asNewtype<auth.OAuthRedirect>('https://cloud.enso.org'),
production: newtype.asNewtype<auth.OAuthRedirect>('http://localhost:8080'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add here fixme (and create issue) that this is temporary and should be fixed to support both gui watch and cloud environment

@PabloBuchu
Copy link
Contributor

@somebody1234 QA 🟢 please open for review and enable authentication and new dashboard by default here

@somebody1234 somebody1234 marked this pull request as ready for review May 9, 2023 13:33
Copy link
Member

@wdanilo wdanilo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cloud.enso.org should work - we will be testing that with clients side by side the electron app. The electron app will be the basic distribution way, but the cloud version should work, so something that breaks cloud version cannot be merged.

@somebody1234
Copy link
Contributor Author

google login seems to work but I do get this error in the console:
OAuth - Error handling auth response. Error: invalid_grant

@somebody1234
Copy link
Contributor Author

@PabloBuchu would you happen to know what's happening here?

@PabloBuchu PabloBuchu requested a review from wdanilo May 10, 2023 09:04
@somebody1234
Copy link
Contributor Author

can no longer repro the issue with google login

@somebody1234
Copy link
Contributor Author

github login seems to be broken for me - i think i remember this being fixed somewhere else, will try again after merging develop

@somebody1234
Copy link
Contributor Author

somebody1234 commented May 10, 2023

confirmed to be fixed after the merge with develop. i also tried creatiing a new github account, which works, but redirects to login page after creation (instead of directly logging in) for some reason. not sure whether this is a major issue though, and can't repro as it's not possible to un-register a github login (which is a good thing, of course, but bad for debugging this specific issue)

@somebody1234
Copy link
Contributor Author

switched npm run watch-dashboard from localhost:8081 to localhost:8080.
basic testing seems to work:

  • running watch-dashboard on localhost:8080 works
  • google login works
  • github login on dev environment still wonky with OAuth - Error handling auth response. Error: User+is+not+confirmed.+. i'm assuming my github login is in a broken state though - @PabloBuchu you might want to test this (npm run watch-dashboard, pbuchu environment in config.ts, github login)

@PabloBuchu
Copy link
Contributor

QA 🟢

  • run gui watch: login with github/google (new account) works. when registering a new account you will receive confirmation email where links points to cloud.enso.org. Confirmation will work but redirect uri will try to open desktop enso. If you manually go back to localhost:8080 you will be able to login. This works as expected as system runs on production environment and desktop mode
  • build:
    -- debug scenes 🟢 / 🟡 (@somebody1234 when you try to open ide scene and try to login I am getting Prevented navigation to 'https://production-enso-domain.auth.eu-west-1.amazoncognito.com/oauth2/authorize?redirect_uri=https%3A%2F%2Fcloud.enso.org&response_type=code&client_id=4j9bfs8e7415erf82l129v0qhe&identity_provider=Github&scope=email%20openid&state=sJ9BkgDjY1LseHCzQMIeqx7zrQ1ulnmm&code_challenge=CwV_qRHueptDorBOSgjFL6Xj6BGvmaE-OTiaCsZgF6E&code_challenge_method=S256'., it can be fixed separately imho if its difficult, looks like the auth api wasnt registered when openning in debug mode.)
    -- normal run 🟢
  • run ide watch github/google buttons wont work because there is not real binary to open and we can't dynamically register url handlers (also any insstalled binary will take precedence). email/password work as usual

@somebody1234 somebody1234 changed the title Fix login for ./run gui watch Fix redirect paths and enable authentication and new dashboard by default May 10, 2023
@sylwiabr
Copy link
Member

@somebody1234 is anything else needed in this PR? @wdanilo can you check it and accept if everything is ok? (otherwise the PR can not be merged)

@somebody1234
Copy link
Contributor Author

implementation wise i think it's good to go - there is one issue found by QA but i think it's better to figure out the right way to solve that in an issue

@somebody1234
Copy link
Contributor Author

somebody1234 commented May 11, 2023

oh actually one thing - the redirect url for ./run ide build is cloud.enso.org - i think it should be localhost:server_port just like for ./run gui build?

... on second thought, this will be a little tricky because the server port isn't known until runtime...

i guess the only way to make this work is to intercept redirects to cloud.enso.org. not sure if that's already being done in the IDE?

... actually i might as well just see what's going on in debug mode

@PabloBuchu PabloBuchu added the CI: Ready to merge This PR is eligible for automatic merge label May 11, 2023
@somebody1234
Copy link
Contributor Author

quick mini QA:

  • run gui build
    • login with gmail: works
    • login with github: works
    • regular login: still works
    • GET /login: still works

i'm skipping QA of everything else, because the main changes in the most recent merge are related to the gui watch service worker.

@PabloBuchu PabloBuchu mentioned this pull request May 11, 2023
5 tasks
@mergify mergify bot merged commit 866501f into develop May 11, 2023
@mergify mergify bot deleted the wip/sb/fix-gui-watch-login branch May 11, 2023 15:11
Procrat added a commit that referenced this pull request May 12, 2023
* develop:
  Implement loading spinner for visualisations. (#6512)
  Fix blank input port (#6614)
  Add `Date_Range` (#6621)
  All Vector operations shall be applicable on java.util.ArrayList (#6642)
  Fix redirect paths and enable authentication and new dashboard by default (#6605)
  Fix #6287: wrong nested breadcrumb ordering (#6617)
  Whitelist AWS Cognito domains (#6643)
  Revert "Add COOP+COEP+CORP headers (#6597)" (#6647)
  Fix shortcuts table formatting (#6644)
  Automatic type based dropdown does not include singleton in a union type (#6629)
  Make Meta.get_annotation work for constructor (#6633)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: No changelog needed Do not require a changelog entry for this PR. CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants