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
API: Auth Api - Account Creation Spike*: reference STRR and BAR #31430
What's the spike for? The devs that did this for STR/BAR are on this project
Lekshmi built a wrapper in STRR we thought for this so this is just to have a look at that and consider adding it into auth-api or if we'll just add that into legal-api or maybe we don't need a wrapper for our case. The spike is just to have a look at what was done in STRR and talk with the BE code owners of auth/legal for adding it
ok, but the future is to have this in business-api, as auth has already stated that they should not be BR bound.
Unless that has changed, I'd think we'd just use the calls already there (I left the video of it in the Teams Channel) or wrap it in the business-api if needed
Auth API call made using service/system account token (with admin access).
Proxy for auth api GET /auth/api/v1/orgs?name={account_name.strip()}
GET /account
Find user accounts by auth token
Proxy for auth api GET /auth/api/v1/users/orgs
POST /account
Create user account with payload
Validates payload against a schema (could have API specific rules)
Creates api model user with specific roles based on the token.
Proxy for auth api POST /auth/api/v1/orgs to create account with access=REGULAR, type=BASIC, product subscriptions=?, payment method=?. Payload includes mailing address if present.
Proxy for second auth api call POST /auth/api/v1/orgs/{account_id}/contacts to add contact email and phone number.
If searching by name is a requirement then calling the auth api using service account credentials is sufficient to justify using a business api wrapper/proxy service.
Otherwise the auth api could be called directly by the UI if the auth api is enhanced to combine account creation and updating contact information.
Further analysis
Is the payment method coming from the request payload or always a default. For STRR it is DIRECT_PAY.
I think in our case we'll also always do DIRECT_PAY (this is credit card). They can update it later if they want (other payment types require more details like bank info etc.)
@deetz99 thanks, I was only looking at account creation. Both the auth api call to get the current terms, and to update the user accepted terms, are wrapped with STRR:
GET/PATCH /api/v1/users/@me
GET /api/v1/documents/termsofuse
The auth api could be called directly to get/set the terms as part of creating an account.
@seeker25 for simplified auth api account creation, is it possible to collapse create account followed by add contact info into one create account request?
Instead of calling POST /orgs followed by POST /orgs/{account_id}/contacts, can contacts be added to the POST /orgs payload to create a contact as well?
Activity
thorwolpert commentedon Nov 26, 2025
What's the spike for?
The devs that did this for STR/BAR are on this project
kialj876 commentedon Nov 26, 2025
Lekshmi built a wrapper in STRR we thought for this so this is just to have a look at that and consider adding it into auth-api or if we'll just add that into legal-api or maybe we don't need a wrapper for our case. The spike is just to have a look at what was done in STRR and talk with the BE code owners of auth/legal for adding it
thorwolpert commentedon Nov 26, 2025
ok, but the future is to have this in business-api, as auth has already stated that they should not be BR bound.
Unless that has changed, I'd think we'd just use the calls already there (I left the video of it in the Teams Channel) or wrap it in the business-api if needed
doug-lovett commentedon Nov 28, 2025
STRR Wrapper Analysis:
GET /account/search
GET /account
POST /account
If searching by name is a requirement then calling the auth api using service account credentials is sufficient to justify using a business api wrapper/proxy service.
Otherwise the auth api could be called directly by the UI if the auth api is enhanced to combine account creation and updating contact information.
Further analysis
Is the payment method coming from the request payload or always a default. For STRR it is DIRECT_PAY.
kialj876 commentedon Dec 1, 2025
Looks like in auth-web they use a public endpoint to validate the name of the account (I think this means we don't need our own searching by name call?): https://test.api.connect.gov.bc.ca/auth-dev/api/v1/orgs?validateName=true&name=... - with user token
I think in our case we'll also always do DIRECT_PAY (this is credit card). They can update it later if they want (other payment types require more details like bank info etc.)
doug-lovett commentedon Dec 1, 2025
@kialj876 thanks, verified GET https://test.api.connect.gov.bc.ca/auth-dev/api/v1/orgs?validateName=true&name= in DEV. Returns 200 if the name exists, 204 if no match.
deetz99 commentedon Dec 1, 2025
Looks like the terms of use calls were also wrapped in strr:
https://github.com/bcgov/STRR/blob/main/strr-api/src/strr_api/resources/users.py#L56
doug-lovett commentedon Dec 1, 2025
@deetz99 thanks, I was only looking at account creation. Both the auth api call to get the current terms, and to update the user accepted terms, are wrapped with STRR:
GET/PATCH /api/v1/users/@me
GET /api/v1/documents/termsofuse
The auth api could be called directly to get/set the terms as part of creating an account.
doug-lovett commentedon Dec 1, 2025
@seeker25 for simplified auth api account creation, is it possible to collapse create account followed by add contact info into one create account request?
Instead of calling POST /orgs followed by POST /orgs/{account_id}/contacts, can contacts be added to the POST /orgs payload to create a contact as well?
seeker25 commentedon Dec 1, 2025
@JohnamLane -^
doug-lovett commentedon Dec 4, 2025
@seeker25 @JohnamLane ^^ hoping to get an answer for development in the next few sprints.
seeker25 commentedon Dec 4, 2025
I can add it in no problem as @JohnamLane gives me the go ahead, if we need we can use a V2 route, but existing V1 probably is fine
doug-lovett commentedon Dec 5, 2025
Thanks @seeker25
doug-lovett commentedon Dec 9, 2025
Moving to done, spike analysis completed.