bcgov / entity

ServiceBC Registry Team working on Legal Entities
Apache License 2.0
23 stars 59 forks source link

Unable to pay for an NR using BCOL or PAD.(All users redirecting to pay through cc Card) #7304

Closed riyazuddinsyed closed 3 years ago

riyazuddinsyed commented 3 years ago

Bug in NameRequest UI:

Case 1: When a user Logs in with a BCSC user who has a Premium Account or PAD account. Then if he navigates through the Name Request app after logged in. Then the NameRequest app doesn't have a valid login with the same User thereby compelling the users to pay through a CC card.

Case 2: When a user logs in to the name request URL which is "https://test.bcregistry.ca/namerequest/" then after a successful Login with a BCSC user who has more than one account then the user doesn't know from which account is the payment happening And there is no way for the user to navigate between the accounts Or selecting the Premium account.

Change to SBC-Auth

Open NameRequest in the current tab (instead of a new tab). This way, the account and user data are retained. (Ie, session storage is not copied over when a new tab is created.)

sumesh-aot commented 3 years ago

Name request app needs similar piece of code in main.ts to auto-authenticate the user if a session exists.

they need similar piece of code on their main.ts file on app init.


async function syncSession () {
  await KeyCloakService.setKeycloakConfigUrl(`${process.env.VUE_APP_PATH}config/kc/keycloak.json`)

  // Do not do auto authenticate the user if user is trying a login or logout
  if (!CommonUtils.isSigningIn() && !CommonUtils.isSigningOut()) {
    // Initialize token service which will do a check-sso to initiate session
    await KeyCloakService.initializeToken(null).then(() => {}).catch(err => {
      if (err?.message !== 'NOT_AUTHENTICATED') {
        throw err
      }
    })
  }
}
sienna-oldaccountdontuse commented 3 years ago

This bug is causing this ops ticket. WHen this bug is fixes, please comment in this ops ticket and tag me, so i can let the client know we have fixed it.

https://app.zenhub.com/workspaces/entity-5bf2f2164b5806bc2bf60531/issues/bcgov/entity/7310

severinbeauvais commented 3 years ago

Testing Notes

  1. Try with BCeID, IDIR and BCSC
  2. Try with BCOL account and others
  3. Try logging in from NR UI, then go to BCROS pages (eg, https://dev.bcregistry.ca/business/auth/home/decide-business) and confirm you are still logged in to same account and user
  4. Try logging in from BCROS pages, then go to NR UI (eg, https://dev.bcregistry.ca/namerequest/) and confirm you are still logged in to the same account and user
  5. Try logging out from NR UI, then go to BCROS pages and confirm you are also logged out there
  6. Try logging out from BCROS pages, then go to NR UI and confirm you are also logged out there
  7. Try payments using all possibilities
severinbeauvais commented 3 years ago

~Note: payment testing is blocked by # 7332~ Update: BCOL payment is fine with BCREG0001.

~Note: this fixed is deployed to Dev but cannot be deployed to Test/Prod until Kial/Thor are finished there and have back-ported/merged their code to the namerequest main branch.~ Update: header changes are now in main branch. See other comments for deployment status.

severinbeauvais commented 3 years ago

Note: the implemented fix (as per Sumesh's code above) does not completely solve this problem. Specifically, although the account login is maintained, it reverts to the first user in NR UI... However the user can see this and change it if desired.

To maintain both the account login and user will require some extra work (not sure what exactly)... One work-around is to open NR UI in the same page when the user clicks "Request a Name". (Currently NR UI opens in a new tab and thus loses some of the login data.)

severinbeauvais commented 3 years ago

I have updated the description and implemented the second part of this ticket (ie, open NameRequest in same tab from BCROS pages).

This is deployed to Dev and I have tested it there: if I am logged in to auth-web with an account with multiple users (and I am using, say, the second user), then when I am redirected to NameRequest, the account and user are retained.

@sumesh-aot @jyoti3286 What is Relationships team's plan to deploy the latest sbc-auth changes to Test and Prod?

@lmcclung @Kaineatthelab FYI!

severinbeauvais commented 3 years ago

I just heard that auth-web (sbc-auth) will release to Prod in 2 days. Meanwhile, NR will have a release today maybe. These 2 changes don't depend on each other but both are required to resolve THIS ticket.

@forgeuxGH5 @tlebedovich Can you please confirm that the implemented fixes are OK? See comments above and/or verify in Dev.

@lmcclung @Kaineatthelab @jyoti3286 Can you please confirm your approvals to deploy these changes to sbc-auth and NR UI ASAP? Thanks!

tlebedovich commented 3 years ago

I don't have enough knowledge of this to review. Hopefully @forgeuxGH5 does.

forgeuxGH5 commented 3 years ago

Looking at this now

severinbeauvais commented 3 years ago

@forgeuxGH5 FYI...

Change 1: updated NR UI to sync to existing Keycloak token (ie retain general login data)

Change 2: updated BCROS to open NR in same tab (so session storage is retained -- esp the account user)

severinbeauvais commented 3 years ago

@jyoti3286 @saravanpa-aot Can the auth-web changes made by this ticket (in this PR) be deployed through to Test/Prod today? This is very low risk but will allow NR UI to use the full KC/login data, as required by this ticket. Thanks!

saravanpa-aot commented 3 years ago

@severinbeauvais I can do that. Did we get approval from @forgeuxGH5 or do we have to wait for it? Will be hard to revert it back if we don't have approval. @jyoti3286

forgeuxGH5 commented 3 years ago

I'm still looking at the scenarios - there are bugs in the account switching. I also can't get payment to go through with PAD - I get an error, but it's not my account so I'm not sure how the account is set-up (if it actually works). I'm just finishing up my review and I'll post here ASAP.

Kaineatthelab commented 3 years ago

@saravanpa-aot do you have 10 min to discuss the bugginess? maybe 950?

severinbeauvais commented 3 years ago

I'm still looking at the scenarios - there are bugs in the account switching. I also can't get payment to go through with PAD - I get an error, but it's not my account so I'm not sure how the account is set-up (if it actually works). I'm just finishing up my review and I'll post here ASAP.

Yes, PAD payment is known error (see #7332).

Try bcreg0001 with user "BC ONLINE TECHNICAL TEAM DEVL".

forgeuxGH5 commented 3 years ago

Here's where I'm at: Payment on Premimum account with PAD didn't go to credit card but did not go through on PAD - encountered error. Will retry with different account. Logging in from Name Request remains on Name Request page after log in - Yes Logging in from Name Request retains information entered prior to log in - No - clears data Switching account from Name Request remains on Name Request view - No - returns to Registries Home Switching account from Name Request retains information entered prior to switching account - No - goes to last state of account (Account info page)

severinbeauvais commented 3 years ago

Will be hard to revert it back if we don't have approval.

Yes, but this change (in auth-web) has low impact either way: either NR UI opens in a new tab, or in the same tab. So does it matter? (Should make approval easier?)

jyoti3286 commented 3 years ago

Thanks @severinbeauvais . This is good to go from our side. @saravanpa-aot is deploying the changes to test and we are planning to do a release on Thursday so this will be part of that. @Milan-Freshworks is doing the regression, perhaps @riyazuddinsyed should also do it from his end. @Kaineatthelab @lmcclung - FYI

lmcclung commented 3 years ago

@riyazuddinsyed I think you said this was already in prod. does it still need QA?