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

feat(users): Decision manager flow changes for SSO #4995

Merged
merged 10 commits into from
Jun 24, 2024

Conversation

ThisIsMani
Copy link
Contributor

@ThisIsMani ThisIsMani commented Jun 13, 2024

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

This PR adds SSO flows in login decision flows. Currently they are disabled as we have no APIs for SSO and will be enabled in upcoming PRs which adds SSO APIs.

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

Closes #4992.

How did you test it?

  • There should be no changes in any of the flows.
  • SPT changes can be tested as follows:
    1. Generate SPT using any of the token only APIs (I am using Sign in)

      curl --location 'http://localhost:8080/user/v2/signin?token_only=true' \
      --header 'Content-Type: application/json' \
      --data-raw '{
          "email": "email",
          "password": "password"
      }'
      
      {
          "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiZTY4YzFmZTQtODRiMC00Y2NjLWI4NGYtN2VjYmVkNjg5Y2Q5IiwicHVycG9zZSI6InRvdHAiLCJvcmlnaW4iOiJzaWduX2luIiwicGF0aCI6W10sImV4cCI6MTcxODg3MzYyN30.HK_0mcCyvbFwh-nma48Pbeh2kdkO7s3FsVOtIc6UF9w",
          "token_type": "totp"
      }
      
    2. Complete the next step

      curl --location 'http://localhost:8080/user/2fa/terminate?skip_two_factor_auth=true' \
      --header 'Authorization: SPT with Purpose as `totp`' \
      
      {
          "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMzBkOGVkYTEtOWM2ZC00MjgwLTg3MDgtN2MwMjBjY2U1ZmNkIiwicHVycG9zZSI6ImFjY2VwdF9pbnZpdGF0aW9uX2Zyb21fZW1haWwiLCJvcmlnaW4iOiJhY2NlcHRfaW52aXRhdGlvbl9mcm9tX2VtYWlsIiwicGF0aCI6WyJ0b3RwIl0sImV4cCI6MTcxODg3OTQ3OH0.tLsVZ-kYbaxaXaq3Jn4-kJ0ghswonTCjbclUrWZLeoc",
          "token_type": "accept_invitation_from_email"
      }
      

      The above token when decoded (using this), it should have the path field with the step that has been completed. And the SPT body will look something like this:

      {
        "user_id": "30d8eda1-9c6d-4280-8708-7c020cce5fcd",
        "purpose": "accept_invitation_from_email",
        "origin": "accept_invitation_from_email",
        "path": [
          "totp"
        ],
        "exp": 1718879478
      }
      

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible

@ThisIsMani ThisIsMani added C-feature Category: Feature request or enhancement S-waiting-on-review Status: This PR has been implemented and needs to be reviewed A-users Area: Users labels Jun 13, 2024
@ThisIsMani ThisIsMani self-assigned this Jun 13, 2024
@ThisIsMani ThisIsMani requested review from a team as code owners June 13, 2024 10:36
Copy link
Contributor

@apoorvdixit88 apoorvdixit88 left a comment

Choose a reason for hiding this comment

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

LGTM, we can get this merged to use new purposes in auth select

@likhinbopanna likhinbopanna added this pull request to the merge queue Jun 24, 2024
Merged via the queue into main with commit 8ceaaa9 Jun 24, 2024
11 checks passed
@likhinbopanna likhinbopanna deleted the sso-decision-flows branch June 24, 2024 12:35
pixincreate added a commit that referenced this pull request Jun 24, 2024
…ough-hyperswitch-cypress

* 'main' of github.com:juspay/hyperswitch:
  feat(router): add support for googlepay step up flow (#2744)
  fix(access_token): use `merchant_connector_id` in access token (#5106)
  feat: added kafka events for authentication create and update (#4991)
  feat(ci): add vector to handle logs pipeline (#5021)
  feat(users): Decision manager flow changes for SSO (#4995)
  ci(cypress): Fix payment method id for non supported connectors (#5075)
  refactor(core): introduce an interface to switch between old and new connector integration implementations on the connectors (#5013)
  refactor(events): populate object identifiers in outgoing webhooks analytics events during retries (#5067)
  Refactor: [Fiserv] Remove Default Case Handling (#4767)
  chore(version): 2024.06.24.0
  fix(router): avoid considering pre-routing results during `perform_session_token_routing` (#5076)
  refactor(redis): spawn one subscriber thread for handling all the published messages to different channel (#5064)
  feat(users): setup user authentication methods schema and apis (#4999)
  feat(payment_methods): Implement Process tracker workflow for Payment method Status update (#4668)
  chore(version): 2024.06.20.1
  chore(postman): update Postman collection files
  fix(payment_methods): support last used for off session token payments (#5039)
  ci(postman): add net_amount field test cases (#3286)
  refactor(connector): [Mifinity]dynamic fields for mifinity (#5056)
  refactor(payment_method): [Klarna] store and populate payment_type for klarna_sdk Paylater in response (#4956)
@SanchithHegde SanchithHegde removed the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label Jun 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-users Area: Users C-feature Category: Feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat(users): Decision manager changes for SSO Flows
5 participants