3

So I am using Process Maker in my laravel application to get a lot of work done. But my employers don't like their APIs and I personally don't either. They are too confusing. Plus we don't need all the functionality.

So I am creating APIs in laravel itself to consume those APIs and transform the data coming in and going out to my preference. Since PM has OAuth2 in it, we are using that.

But we need authentication in our system too. So we are using JWT tokens for it. And the JWT token holds the access token for the PM application when it needs to be consumed within my application.

My problem is that now I am using the user base of PM, my policies in laravel are failing and the old APIs built using those policies are failing as well. The reason being that the user table in my application does not really have the users anymore and their permissions are failing.

So would it be a good idea to use the User model in laravel and connect it to PM's user table using the $connection and $table property or would it better to hack up a non eloquent base User model and let laravel authenticate using that. And that model will hit PM's APIs for fetching users and so on.

Has anyone had similar experience while working with laravel and what is a suitable solution to go for it? Because I am really confused on how to tackle such a scenario.

Rohan
  • 13,308
  • 21
  • 81
  • 154
  • maybe as an alternative you could try extending the rest api of processmaker vía a plug-in so you can modify the endpoints or create new ones based directed on the existing ones http://wiki.processmaker.com/index.php/Gulliver%3A_Programmer%2527s_Reference_Guide also you could see this endpoints http://wiki.processmaker.com/3.0/Light_endpoints that are a little less messy. – Pedro Teran Oct 17 '16 at 15:44
  • 1
    It sounds like a really long and complicated workaround just to provide a wrapper around the ProcessMaker REST API. Full disclosure, I work at ProcessMaker. That being said, we do have a fully RESTful API that is pretty much industry standard. We have OAuth 2.0 and RESTful resources. What exactly about it don't you like? If there is something to improve, I'd be happy to take that back to product management and get it improved. – Ethan Presberg Oct 21 '16 at 08:43

1 Answers1

0

There is an rest api is available to get the user's list in processmaker. First the you need to register an api

(Ref:) Click here

if user consuming you need specify the params :

'grant_type'    = 'password',
'scope'         => '*',       //set to 'view_process' if not changing the process
'client_id'     => YYYY45435,
'client_secret' => XXX543543, 
'username'      => jemiris,
'password'      => jfi83