[Fiware-developer-experience] Client side

Alvaro del Castillo acs at bitergia.com
Wed Jul 22 12:25:54 CEST 2015


Hi!

El mié, 22-07-2015 a las 10:20 +0100, Pablo Fernández Moniz escribió:
> Hi all,
> 
> 
> We just upload the light client in GitHub:
> 

Great!

> 
> In the current state, we had removed all the code from the server
> side, therefore we dont have real authentication process. 
> 

Ok, we will propose an implementation similar to what is working in
chanchan, using IDM, Authzforge and PEP Proxy so the complete IDM
management could be explained in the devguide.

> 
> Authentication must be implemented from the client side when its API
> is ready. 
> 
> 
> On the other hand, we have converted the Jinja2 templates to static
> html files.
> 
> 
> 
> 
> Making requests to the restaurants API (or making them to the
> authentication API in the future) have cross-domain issues. We suggest
> some solutions:
> 
> 
> * Add the header 'Access-Control-Allow-Origin: *' to the API
> responses.
> * Use a proxy.
> * Have the web and the API in the same domain.
> 
> 
> For now, we provided a PHP proxy. The proxy url (which should be in
> the same domain that the web application) must be set in the variable
> proxy at the top of the restaurants_api.js file.
> 

The web server is serving the client and the REST API, so they are
sharing domain and no cross domains issues appear.

Right now the docker image in the hub has all working so in order to
test the client and server together you just need to:

fiware-devguide-app/docker/compose $ docker-compose up
sudo get-docker-hosts -m

and go to the URL:

http://compose_devguide_1/client/all_restaurants_and_reviews.html

Next steps:

* Complete auth in the client and server (we will create a proposal from
bitergia)
* Add reviews view: data already available in the image
* Add reservations view: data already available in the image

A pretty easy integration. Great!

Cheers

> 
> 
> 
> Following we explain how was the code before we removed our server
> side part.
> 
> 
> 
> We used the bitergia IdM docker adding to the composer file using this
> instructions:
> 
> 
> 
> 
> authzforce:
>     image: bitergia/authzforce:4.2.0
>     expose:
>         - "8080"
> 
> 
> idm:
>     image: bitergia/idm-keyrock:4.3.0
>     links:
>         - authzforce
>     volumes:
>         - /config
>     expose:
>         - "5000"
> 
> 
> 
> 
> We developed a little Flask application as server. This application
> had a method to authenticate users using the IdM. User info, as could
> be the token, the identificator and roles, was saved in session
> variables. 
> 
> 
> Using these session variables the application decided which pages
> should be shown.
> 
> 
> At render time, we were using Jinja2 templates which allowed us to
> display differents sections based on values of the variables. 
> 
> 
> The Flask application also implemented a proxy that allowed us to make
> AJAX petititions to the restaurants API.
> 
> 
> 
> 
> KR,
> 
> 
> ULPGC Team
> 
> 
> 
> _______________________________________________
> Fiware-developer-experience mailing list
> Fiware-developer-experience at lists.fiware.org
> https://lists.fiware.org/listinfo/fiware-developer-experience


-- 
Alvaro del Castillo San Félix
acs at bitergia.com - Chief Technical Officer (CTO)
http://www.bitergia.com
"Software metrics for your peace of mind"





More information about the Fiware-developer-experience mailing list

You can get more information about our cookies and privacy policies clicking on the following links: Privacy policy   Cookies policy