You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DBC: A (specific?) user with a converted in sole prop has no User record in the business database to compare proprietor name against #30277
Investigating a known user who has an old Sole Proprietorship that is not presented with the Digital Business Card option when they access their SP via BCROS using a BC Services Card.
Won't put PII name/etc in this ticket but have observed the following:
User logs in with a BCSC with their connected mobile app and can access the BCROS
The user account info is
They registered back in 2000 with this SP.
So the registration completing party name is a generic old user name
In 2021 they contacted BC Registries and converted and updated. So those filings are an internal user.
Aside from all the above, the Proprietor Name we have confirmed exactly matches the BCSC name. In the current code this is intended to allow a DBC issuance.
Have investigated with the user and inspected the JWT for their access token (ISS https://loginproxy.gov.bc.ca/auth/realms/bcregistry). The first name and last name in the token match as expected.
The idp_userid is confirmed to have no corresponding record in the business DB users table. Which is not the case for newer Sole Props, the idp_userid for the logged in user session is looked up to find a User, and that User is name matched against the proprietor as the check that should be passing here to allow DBC.
changed the title [-]DBC: A user with a converted in sole prop has no User record in the business database to compare proprietor name against[/-][+]DBC: A (specific?) user with a converted in sole prop has no User record in the business database to compare proprietor name against[/+]on Aug 19, 2025
"
Ok so for the situation with Alykahn I would break it down like this
He has a sole prop that was converted in to the new system
His BCSC name matches the proprietor name
The Profile he has on that Account is a business, not an individual (not sure this matters, does not seem to, but noting)
The idp_userid from the token that his BCSC login for the profile grants does not correspond to a User in the database
We match User to the Proprietor in this case and find nothing, so no DBC option
Even if we did go by an upcoming(?) Account Coordinator/Admin association, what would we issue in the DBC if there is no User record?
So I'm now past my knowledge level an over my head for the auth system and how Users work, so think we'll need someone from Registries to chime in on whether this is a known case? Is Alykhan a data problem? Will this happen for all converted in firms?
"
So will need to follow up with someone shortly on this. (probably SBC Auth developer, Severin suggested a couple folks)
Ameliorated by #31227 for DBC access/issuance
Though for legacy user imported if this case occurs this is something to figure out at some point, especially during phase 3 name-change initiatives. Not specific to Phase 2 (structural with migrated users if this case occurs with any existing DBC implementations)
Encountered a second user, also an older SP migrated in, with this situation (ITOPS-154341) that was confirmed to also have no User record.
Same comment/details as above, should be accessible after #31227, but broader questions come up about the lack of a User record in Lear...
Does this data case need to be taken into account for future DBC requirements/development? IE does "user information" need to be solely from the login token as we can't reliably assume there's a User record?
Regardless of Digital Business Card, for general BC Registries Online Services is this a invalid data case? The Lear database has no User table for some imported users logging in with a BCSC. So the BCSC identifier does not link to any User record. Is this just an expected and fine data condition?
Are there potentially other issues that could happen in BCROS that haven't been encountered yet other than the DBC expecting a User?
Who to discuss this issue with? Auth team? Any DBA concerns with validity of this data model or anything?
For corporation migrations is this going to be a problem that needs taking into account (again, regardless of DBC)? Is this just an artifact of some Firm migration or would/does this happen for Corps? Is it invalid data if so
So when accessing the DBC functionality a user will always pass through a path that actions the new request context setup
User opens business dashboard
→ UI calls GET /businesses/{identifier}/allowableActions (or similar)
→ get_allowable_actions() → get_allowed_filings() → get_request_context()
→ user is get_or_create'd ✅
→ response includes digitalBusinessCard: true/false
Activity
[-]DBC: A user with a converted in sole prop has no User record in the business database to compare proprietor name against[/-][+]DBC: A (specific?) user with a converted in sole prop has no User record in the business database to compare proprietor name against[/+]loneil commentedon Aug 19, 2025
Copying my note from previous chat:
"
Ok so for the situation with Alykahn I would break it down like this
idp_useridfrom the token that his BCSC login for the profile grants does not correspond to a User in the databaseSo I'm now past my knowledge level an over my head for the auth system and how Users work, so think we'll need someone from Registries to chime in on whether this is a known case? Is Alykhan a data problem? Will this happen for all converted in firms?
"
So will need to follow up with someone shortly on this. (probably SBC Auth developer, Severin suggested a couple folks)
loneil commentedon Nov 12, 2025
Ameliorated by #31227 for DBC access/issuance
Though for legacy user imported if this case occurs this is something to figure out at some point, especially during phase 3 name-change initiatives. Not specific to Phase 2 (structural with migrated users if this case occurs with any existing DBC implementations)
loneil commentedon Nov 17, 2025
Encountered a second user, also an older SP migrated in, with this situation (ITOPS-154341) that was confirmed to also have no User record.
Same comment/details as above, should be accessible after #31227, but broader questions come up about the lack of a User record in Lear...
Mihai-QuickSilverDev commentedon Feb 14, 2026
Hi @loneil
loneil commentedon Feb 24, 2026
For the production users we've seen this crop up in I have confirmed they both have DBCs now.
loneil commentedon Feb 24, 2026
It looks like the root cause of this issue has actually been addressed a couple months back in this PR:
bcgov/lear#3762
So this is actually fixed now and doesn't require any further changes.
Now in the request context setup it will do the
User.get_or_create_user_by_jwt()see https://github.com/bcgov/lear/blob/89b8083bed4318847aa9483968088b55a5e66927/legal-api/src/legal_api/services/request_context.py#L39
So when accessing the DBC functionality a user will always pass through a path that actions the new request context setup
User opens business dashboard
→ UI calls GET /businesses/{identifier}/allowableActions (or similar)
→ get_allowable_actions() → get_allowed_filings() → get_request_context()
→ user is get_or_create'd ✅
→ response includes digitalBusinessCard: true/false
Mihai-QuickSilverDev commentedon Feb 25, 2026