WebApp authentication and backend authentication

Hi, I’m having some trouble joining my webapp and my backend, I’ll explain the problem briefly.

I have a functional RestApi, able to login and to write on the POD of a user, I’m using @inrupt/solid-client-authn-node for this RestApi.
On the other hand I have a webapp that wants to consume this RestApi, my first idea was to make the webapp call the restapi, which would redirect to the login provider and show that in the webapp, then after login redirect back to the restapi, save the session and redirect back again to the webapp. Because of some CORS policies I couldn’t redirect to the login provider when making the call from the webapp. Any suggestion would be highly appreciated, and any kind of help too. Thanks in advance!

Hi @Miguel25221 - why do you need this Rest API in the first place? In most cases Solid Applications should read/write directly to a Pod.

Hi @jeswr, since more than one webapp are being developed at the time with the same purpose, the idea would be to have a RestAPI that all of those webapps could consume, providing the login information first.

Then, the RestAPI would be the one that writes to the pod with the information provided.

In that case I’d still be suggesting that each application interfaces directly with the Pod storage using the Solid Protocol without going via a rest API.

If there is any business logic that they share then could this be made into a function that each of the applications imports in their code rather than needing a rest API?