Authentication

Authentication endpoints of the bizSupply API.

Last updated: 2026-07-21

GET /api/v1/auth/login/{provider}

Initiate OAuth2 login with a supported Identity Provider.

Redirects the browser to the IDP authorization endpoint. Supports Google and Microsoft. GCP Marketplace SSO is handled when the request contains an x-gcp-marketplace-token form parameter.

Parameters

NameInRequiredDescription
providerpathyesIdentity provider name (google or microsoft).
redirectUrlquerynoOptional frontend URL to redirect to after successful login.

Responses

StatusDescription
302Redirect to IDP authorization URL
400Unsupported provider

POST /api/v1/auth/login/{provider}

Parameters

NameInRequiredDescription
providerpathyes
redirectUrlqueryno

Responses

StatusDescription
200OK

POST /api/v1/auth/logout

Invalidate the current access token.

Adds the token to the Redis blacklist so it cannot be reused before its natural expiry. The client must also discard the token locally.

Parameters

NameInRequiredDescription
Authorizationheaderyes

Responses

StatusDescription
204Token blacklisted, logout successful
401No valid Bearer token provided

POST /api/v1/auth/refresh

Refresh an expired access token.

Issues a new access token using the provided refresh token. An optional organizationId scopes the token to a specific org; otherwise the user's primary membership is used.

Request body

  • application/jsonRefreshTokenRequest

Responses

StatusDescription
200New access token issued
401Invalid or expired refresh token

POST /api/v1/auth/switch-org

Switch the authenticated user's active organization.

Re-issues the JWT scoped to the target organization. The caller must be a member of the target org. The response includes all memberships for the user.

Request body

  • application/jsonSwitchOrganizationRequest

Responses

StatusDescription
200New JWT issued for the target organization
401Authentication required
403Not a member of the target organization