Skip to content

API: Auth Api - Account Creation Spike*: reference STRR and BAR #31430

Closed

Description

@cameron-eyds
  • Research account creation process
  • Find or reference schemas
  • Verify account name process: ie is it also through a wrapper?

Notes:

Activity

  1. added theissue type on Nov 26, 2025
  2. changed the issue type fromtoon Nov 26, 2025
  3. thorwolpert commented on Nov 26, 2025

    @thorwolpert
    Collaborator

    What's the spike for?
    The devs that did this for STR/BAR are on this project

  4. kialj876 commented on Nov 26, 2025

    @kialj876
    Collaborator

    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

  5. thorwolpert commented on Nov 26, 2025

    @thorwolpert
    Collaborator

    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

  6. self-assigned this
    on Nov 28, 2025
  7. doug-lovett commented on Nov 28, 2025

    @doug-lovett
    Collaborator

    STRR Wrapper Analysis:

    GET /account/search

    • Find accounts by "name" request parameter
    • 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.

  8. kialj876 commented on Dec 1, 2025

    @kialj876
    Collaborator

    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.)

  9. doug-lovett commented on Dec 1, 2025

    @doug-lovett
    Collaborator

    @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.

  10. deetz99 commented on Dec 1, 2025

    @deetz99
    Collaborator

    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

  11. doug-lovett commented on Dec 1, 2025

    @doug-lovett
    Collaborator

    @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.

  12. doug-lovett commented on Dec 1, 2025

    @doug-lovett
    Collaborator

    @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?

  13. seeker25 commented on Dec 1, 2025

    @seeker25
    Contributor
  14. doug-lovett commented on Dec 4, 2025

    @doug-lovett
    Collaborator

    @seeker25 @JohnamLane ^^ hoping to get an answer for development in the next few sprints.

  15. seeker25 commented on Dec 4, 2025

    @seeker25
    Contributor

    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

  16. doug-lovett commented on Dec 5, 2025

    @doug-lovett
    Collaborator

    Thanks @seeker25

  17. doug-lovett commented on Dec 9, 2025

    @doug-lovett
    Collaborator

    Moving to done, spike analysis completed.

  18. changed the issue type fromtoon Jan 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions