External Users #203
MaheshkumarSundaram
started this conversation in
General
Replies: 1 comment 1 reply
-
Hi @MaheshkumarSundaram Using bpmn-client, you just need to pass user information along with API_KEY Using new API2 that enforces security: import { BPMNClient2 } from './';
test();
async function test() {
const dotenv = require('dotenv');
dotenv.config();
console.log('env:',process.env.HOST, process.env.PORT, process.env.API_KEY);
var caseId = Math.floor(Math.random() * 10000);
let user={userName:"John",userGroups:['employee']};
let name = 'Buy Used Car';
let response;
let instanceId;
let options={noWait:true};
const server1 = new BPMNClient2(process.env.HOST, process.env.PORT, process.env.API_KEY);
response = await server1.engine.start(name, {caseId: caseId},user,options);
console.log(response.id);
response = await server1.engine.invoke({id: response.id , "items.elementId": 'task_Buy' },null,user,options);
console.log('invoked',response.id);
} please note that user info are passed to the server and are used for security check: let user={userName:"John",userGroups:['employee']}; To enforce Security you need to edit .env file :
Your feedback please... |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi @ralphhanna,
I would like suggestion on handling users' assignment and maintenance that are external to
bpmn-web
.I have my main web application running in Node.js, React with MySQL. The users are stored in MySQL with a slightly different schema as that of
users
collection inbpmn-web
. All the authentications and securities are enforced by my Node.js backend.Interaction with
bpmn-web
is done from my Node.js backend usingbpmn-client
.Now, my dilemma is how to work through the users bit of
bpmn-web
😕. For eg; if I want to assign a user to a User Task, I have all the relavant information in my backend but I am not sure propagate that info tobpmn-web
without needing to maintain two source of users - one in MySQL and a collection in Mongo. I can't move users to Mongo from MySQL due to a design constraint 😑.I am stuck on how to achieve seamless interaction of both these applications with users 😖!
Any help would be appreciated. Thank you.
Beta Was this translation helpful? Give feedback.
All reactions