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

feature/sc-117249/add-a-sso-flag-to-cli-login #637

Merged
merged 16 commits into from
Apr 12, 2023

Conversation

hugomontero
Copy link
Contributor

@hugomontero hugomontero commented Apr 11, 2023

Description

This PR will add the ability to login over sso

How to Test

  1. Pull down the branch: git pull && git checkout feature/sc-117249/add-a-sso-flag-to-cli-login
  2. Reinstall dependencies: npm run reinstall
  3. Run tests: npm test
  4. Try to run the new login param: npm start -- login --sso

Outcome

  • Tests should pass
  • Once running the command it will open you a browser with activation step to follow.
  • After activate your code, you will be logged in with you sso account

Related Issues / Discussions

Story details : sc-117249

Completeness

  • User is totes amazing for contributing!
  • Contributor has signed CLA
  • Problem and solution clearly stated
  • Tests have been provided
  • Docs have been updated
  • CI is passing

@hugomontero hugomontero changed the title Feature/sc 117249/add a sso flag to cli login feature/sc-117249/add-a-sso-flag-to-cli-login Apr 11, 2023
@keeramis
Copy link
Contributor

keeramis commented Apr 12, 2023

Great work @hugomontero 🎉
In the following 'failure' case where I am trying to login from different account, it fails in the browser as expected. However, I am not seeing that error getting propagated to the WB immediately. My WB is still waiting on the sso command.

Is that expected?

Screen Shot 2023-04-12 at 1 42 35 PM

(feature/sc-117249/add-a-sso-flag-to-cli-login) $ npm start -- login --sso

> particle-cli@3.8.1-rc.2 start /Users/keerthyamisagadda/code/particle-cli
> node ./src/index.js "login" "--sso"

▄ SSO login in progress...
Opening the SSO authorization page in your default browser.
If the browser does not open or you wish to use a different device to authorize this request, open the following URL:

https://id.particle.io/activate?user_code=FZDBLZCB
▀ SSO login in progress... (errored already in browser)

Edit

After waiting long enough, I got the relevant error.
image

@hugomontero
Copy link
Contributor Author

Great work @hugomontero 🎉 In the following 'failure' case where I am trying to login from different account, it fails in the browser as expected. However, I am not seeing that error getting propagated to the WB immediately. My WB is still waiting on the sso command.

Is that expected?

Screen Shot 2023-04-12 at 1 42 35 PM
(feature/sc-117249/add-a-sso-flag-to-cli-login) $ npm start -- login --sso

> particle-cli@3.8.1-rc.2 start /Users/keerthyamisagadda/code/particle-cli
> node ./src/index.js "login" "--sso"

▄ SSO login in progress...
Opening the SSO authorization page in your default browser.
If the browser does not open or you wish to use a different device to authorize this request, open the following URL:

https://id.particle.io/activate?user_code=FZDBLZCB
▀ SSO login in progress... (errored already in browser)

Edit

After waiting long enough, I got the relevant error. image

Yeah that's expected, the code still alive and the only way your code expires is:

  • After 600 seconds
  • You've been activated the code before.

I have some failure case handling but are more like:

  • Okta fails with a different error (is down or something like that)
  • The request fails for a unexpected reason

Copy link
Member

@monkbroc monkbroc left a comment

Choose a reason for hiding this comment

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

The interactions with Okta look good, but the UI code needs a bit of tweaking.

src/lib/sso.js Outdated Show resolved Hide resolved
src/cmd/cloud.js Outdated Show resolved Hide resolved
@hugomontero hugomontero merged commit 93403e4 into master Apr 12, 2023
@hugomontero hugomontero deleted the feature/sc-117249/add-a-sso-flag-to-cli-login branch April 12, 2023 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants