Hi everybody,
I need to provide APIs to third part partner from my Wappler WebApp.
I looked after third part software (postmann, xano, swagger, insomnia…) But since Wappler already generate JSON APIs it looks easier to use Wappler.
I need to provide secured access - I don’t want my APIs to be public and I need to autorise endpoints regarding the partner and the common-customer. ie I need APIs keys / token for each APIs user.
How could I manage with it?
ie. what is the best way to set these access? (Permission? users in DB?) I’m a bit lost.
And how should I do precisely to restrict access to server connect and load or insert needed infos / APIs users?
For the moment I need to provide few endpoints to list / collections and 1 insert.
And I only work with 1 partner to connect our 2 apps. For a demo case.
(This will grew up quickly during the next weeks)
I'm not sure the best way to generate API keys, but you can use regular credentials and add a Security Restrict option on the APIs to keep them from being available publicly. There's an option to define Permissions if you want to limit it to certain users.
Also, I'm guessing you're going to want to provide standard REST method options, so please vote for this feature request. Right now Wappler only supports GET and POST, so you've got to build workarounds to allow for deletes and updates, which isn't following REST standards.
You should not use the Security Restrict to secure your API. This will require the users to always login to your system before making any API calls. I suggest you create a special table to store users’ identity (ID) and their access tokens, which can be generated by the users using the system.
For each request, a unique access_token has to be provided which you can use check if it exists in the system and who such token belongs to. For a more secured access_token, you would have to use some cryptographic algorithms on the token provided by the user using from the server connect and compare with what you have in the system.
You can use the JWT to authenticate the user and then log them in via security provider or just use the JWT itself and generate a cookie but that would require your own session system.
A JWT is just great for API token since you can sign it, store info and set an expiration date.