2.0.2 • Published 11 months ago
@alpin11/vendure-b2b-suite-v2 v2.0.2
Vendure B2B Suite
This plugins extends Vendure applications and other plugins with new Entities, Services, API Resolvers, and Strategies.
Publish
To publish this plugin as an NPM package, execute the publish.sh file in the scripts folder. This will build and publish it for you.
Installation
To get started with this plugin, run the following command in your vendure project to install it.
yarn install @alpin11/vendure-b2b-suite-v2
# or
npm install @alpin11/vendure-b2b-suite-v2
Then you need to configure the existing VendureConfig object inside the vendure-config.ts, and add the plugin to the plugin array.
Usage
To use the plugin, start the local development server and the Vendure worker with the command below.
# Start both the local development server and worker
yarn start
# To only start the server run
yarn dev:run:server
# To only start the worker run
yarn dev:run:worker
# To generate new GraphQl types run
yarn dev:generate-types
Active Directory Authentication
sequenceDiagram
actor Employee
participant Frontend
participant Vendure
participant MicrosoftLogin
participant MicrosoftGraph
Employee->>Frontend: Login
Frontend->>Employee: Redirect To Microsoft Login
Employee->>MicrosoftLogin: Login User
MicrosoftLogin->>Frontend: Send Access Token & ID Token to Redirect
Frontend->>Vendure: Login User with Microsoft
Vendure->>MicrosoftLogin: Request Signing Keys
MicrosoftLogin->>Vendure: Get Signing Keys
Vendure->>Vendure: Validate JWT with Signing Keys
Vendure->>MicrosoftGraph: Get Groups of user
MicrosoftGraph->>Vendure: Return Groups for user
Vendure->>Vendure: Update User Roles
Vendure->>Frontend: Return Vendure Login Token
Magic Link Authentication
sequenceDiagram
actor Customer
actor Employee
participant Frontend
participant Vendure
Employee->>Vendure: Send out Invitation via Magic Link
Vendure->>Vendure: Create Customer and add Magic Token
Vendure->>Customer: Send Invitation Email
Customer->>Frontend: Open Magic Link
Frontend->>Vendure: Login with MagicLink Token
Vendure->>Frontend: Return Vendure auth Token
opt Popover, create Password
Frontend->>Customer: optional create password authentication
end
Contributors
This plugin was developed by the following contributors: